Basics of Templatizing
There’s a standard way of creating templates. We all know it. We all don’t know how we learned it. My question is; is it documented?
The programming language used in the base implementation for a templating system shouldn’t dictate how it’s structured. Templating is generic, very generic. I’m also under the impression that templates used in any server-side scripting language should also be broken down in the same manner as any server-side template is done.
I raised the issue that the templates created at my job were (a joke|retarded|in need of a rewrite). They have a main template for a basic HTML page and a template for pop-up windows. So far so good. Within the basic template there is hard-coded crap for printer friendly type pages and some crap for pages that would be hosted on a secure site. Not so good but, whatever. The main issue is that they created a template and then cut that file in to section, and not modularly. The cut it like you’d saw a woman in half. Meaning <html> is in the first file and </html> is in the last file. Why am I making a fuss? They really have 5 websites with about 10 different formations of pages. All which should be there own templates regardless of what domain they reside.
There’s the red-tape and hoops I’d have to go through to even think about fixing this crap. I guess, “barely working in a manner that’s confusing to everyone and involves hacking different files every week” is whats good for everyone. You’d thing they would know the difference between increased productivity and being productive. Besdies, where’s the documentation that says that what originally was created was the perfect approach?
Since this subject is culinary equivalent of boiling water, there is no “Templatetizing for Dummies” book. And if there was, it would be a pamphlet that read, “Turn off the computer. Go watch TV.” So, if anyone has seen a quick write up let me know because I’m not wasting my time and searching for this crap just to beg them to let me fix their screwed up shit. Since this would be a, let me guess, “When we have time in the future” project. Filed under the “If it ain’t broke, don’t fix it” list.
The only way in my experience to get these things which should be obvious into production in a change-hostile environment is to use them on new projects without asking. When $boss sees that projects_by->{boofer} > projects_by->{other_guy} $boss tells other_guy to do it “the way boofer does it.” Unless you have picked your template language though, there’s no best practices book that I know of. If you’re using TemplateToolkit Perl Template Toolkit from O’reilly is pretty good.