Forums Sign Up Reply Search Statistics
Fast Template GraFX Software Solutions - Forum / Fast Template /

Is there away to prevent fasttemplate from removing

 
Author rr1024
Forums Member
#1 Posted: 25 Nov 2007 02:16:52
Reply 
Is there a way to prevent fasttemplate from removing the white spaces from a template file after parsing.

I'd prefer for html debug to have the template retain all it's white spaces.
Author software
Admin
#2 Posted: 28 Nov 2007 17:31:02
Reply 
We don't see any change between the template and the result( other then the data replacement...)
Author rr1024
Forums Member
#3 Posted: 28 Nov 2007 22:17:44
Reply 
If I have a template with since this forum removes white spaces I will use - as my white space for example
header.html

<head>
----<title>My Page</title>
</head>

when you view the page with your browser and then click on view page source in the menu of your browser you get
<head>
<title>My Page</title>
</head>

All white spaces removed. It maybe due to trim being used.....
Is there some need to use trim, some portion of fast template that depends on No White Spaces???
Author software
Admin
#4 Posted: 29 Nov 2007 00:21:38
Reply 
yes, here for example ;)
$lineTest = trim($lineData);
if("<!-- BEGIN DYNAMIC BLOCK: $Macro -->" == "$lineTest" )

Anyway what is the use of this? The template is not overwritten and you
are not working on the html file requested by the browser.
Author rr1024
Forums Member
#5 Posted: 29 Nov 2007 01:10:20
Reply 
mmm, maybe I didn't explain it correctly...laughing what I'm thinking of doing is replacing all the
trim() functions used in fast template with

rtrim( );

This way it keeps the html formating i.e. syntax indents used in the templates when it outputs the html.

I usually trouble shoot my html by viewing the page in a browser then looking at the code in the browser with view -> page - source
Author rr1024
Forums Member
#6 Posted: 29 Nov 2007 07:06:18
Reply 
Ok I got what I needed

Find

$newTemplate .= trim($line) . "\n";

Replace with

$newTemplate .= rtrim( $line ) . "\n";

This allows the output of the template to the browser with white spaces / html syntax indentations intacted.

However, when in debug mode it could be a little annoying to have to inspect long lines of html with the white spaces / html syntax indentations intact.

so to fix this I did the following

Find in printarray( $arr, $caption )

WHILE ( list ( $key, $val ) = each ($arr) ){

Below Add

$lines = split("\n", $val );
#flatten html for debug display
$val = '';
WHILE ( list( $num, $line ) = each( $lines ) ) {
$val .= trim( $line ) . "\n";
}
Author rr1024
Forums Member
#7 Posted: 29 Nov 2007 07:19:16
Reply 
Oh just found another small html bug missing head tags in html debug, that is why the title Debug Console never shows up... ;-)

Find
_debug_console.document.write('<html><title>Debug Console</title><body bgcolor=#ffffff>');

Replace with
_debug_console.document.write('<html><head><title> Debug Console</title></head><body bgcolor=#ffffff>');

Find
_debug_console.document.write('<html><title>Debug Console</title><body bgcolor=#ffffff>');

Replace with
_debug_console.document.write('<html><head><title> Debug Console</title></head><body bgcolor=#ffffff>');
Author software
Admin
#8 Posted: 4 Dec 2007 17:41:43
Reply 
Ok we have included your suggestions in the next release propositions.
Th.
 
Your Reply

» Username  » Password 
Only registered users are allowed to post here. Please enter your login/password details upon posting a message, or sign up first.