in reply to Thoughts on converting from HTML::Template to Template Toolkit

I still have extra blank lines I haven't figured out how to rid myself of, which wasn't an issue with H::T.
If you can effort the extra memory you can use a [%FILTER%] with a simple regex to get rid of the blank lines. But, if your not outputting text/plain who cares about newlines in html, xml and the like?
USEing plugins just feels too much like code to me.
Plugins are one of the strengths of TT. The ability to move the DB logic (DBI connections, querys, etc) into the template, is a feature I don't want to miss anymore. With plugins you can pull in the power of every perl module into your template.


holli, /regexed monk/
  • Comment on Re: Thoughts on converting from HTML::Template to Template Toolkit
  • Download Code

Replies are listed 'Best First'.
Re^2: Thoughts on converting from HTML::Template to Template Toolkit
by Tanktalus (Canon) on Mar 22, 2006 at 20:01 UTC
    But, if your not outputting text/plain who cares about newlines in html, xml and the like?

    Well, as an example, if the blank line was inside the quotes of an attribute, such as:

    <a href="something.html ">
    That would be bad. However, while this particular case I was converting HTML::Template to TT, where that is mostly not an issue, I was also thinking at the same time of using TT at work where we are generating shell scripts. Extra end-of-line characters can be catastrpohic there.

    With plugins you can pull in the power of every perl module into your template.

    No doubt you could. Moving the logic in there, however, gives me some eeby-jeebies. It's great if there's a single developer working on non-translated text. It gets a bit uglier if the file, with its code, gets to go out for translation, or if you have someone who knows code great, and another person who can design the heck out of a website. (I'm definitely not in the latter category - I'd love to get my wife doing the site design instead of me... and too much logic in there will just confuse her.) I get the power. I do. But something about it just makes me feel like it's a power that's drawing me to the "dark side" of intermixing logic and layout.