in reply to Re: Can a Template file be an HTML file?
in thread Can a Template file be an HTML file?

Actually, my advice is the opposite. Put your templates in a template directory, and then keep the .html suffix. Then, when I load the file in most html editors, they recognise it immediately from the suffix. They don't quite "get" the tmpl_ tags, but I can highlight things and mark them "strong" or "em"phasis or "div" or whatever. (For some reason, I don't think my editor allows blink. Oh well :-})

This way, I get all the shortcuts for adding tags, I get the syntax highlighting, and I know they're templates from the directory they're in.

I actually started with your advice: new name, outside directory. I went back on the name because I found I was always telling my editor to pretend that .tmpl was actually HTML, so I cheated by putting them in files that the editor understood were HTML.

And I'm even more glad I did now - I have another templating system based on Text::ScriptTemplate that I use at work where .tmpl is now taken for that - and having my editor autoload .tmpl as HTML would make those look very, very silly. (No, that's not used for webpages, but for almost anything else - including shell scripts.)

  • Comment on Re^2: Can a Template file be an HTML file?

Replies are listed 'Best First'.
Re^3: Can a Template file be an HTML file?
by polettix (Vicar) on Jun 15, 2005 at 00:28 UTC
    The syntax-highlighting hint seems quite good indeed, and as long as one is able to quickly understand which kind of files s?he's dealing with you're perfectly correct (BTW, even a find would remain useful). OTOH, one can use different filename suffixes for different purposes, so you could easily associate .tmpl to HTML highlighting, and say .stpl to the other templating system - but it really becomes a matter of pure personal taste at this point.

    Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

    Don't fool yourself.