macro whitespace
Something cool I noticed today when testing one of my templates...
When using the Macros plugin for smilies or whatever, there tends to be a lot of extra whitespace in the source at the top of the document where the definitions are. In order to keep things neat in my macros module, I put one definition to a line. Which means there are line breaks that make extra white space.
But, when I moved the <$MTInclude module="macros"$>
into the PHP include statement that I use for my header, the white space disappeared. It still works because the macros are processed on rebuild, and the PHP tags process on load... the extra space doesn’t bother the PHP.
Poof! No more ugly whitespace when viewing my source!
Comments
Excellent! I’ll be modding mine the same way, it bugs me when it does that...
Posted by: Gary LaPointe | April 13, 2004 03:50 PM
That’s something else I can play with in my templates. I’ve been tinkering with them most of the day. The changes are small, but everything feels neater now. That counts for a lot in my book.
Posted by: Brandy | April 13, 2004 05:57 PM
Smilies with the macros style increase load time, when you put it into php did it decrease page load time ?
Posted by: Arvind | April 13, 2004 11:07 PM
Cool hint. Thanks, I’ll have to implement that myself.
Posted by: Doc | April 14, 2004 05:19 AM
Hey, I was wondering where all that whitespace in my source was coming from. Thanks for sharing this tip!
Posted by: Liz | April 15, 2004 04:26 PM