in reply to Re: Advice Choosing a Templating System
in thread Advice Choosing a Templating System

Mason is great if the only people who will ever hack your templates are already Perl programmers.

However, the mini-language of Template Toolkit is soooo much easier to teach to non-programmers who might be hacking the HTML of your site. So says my clients that are using TT in their web apps.

So, while you might prefer the Mason approach, there are many reasons to prefer the "mini-language" approach.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on Re^2: Advice Choosing a Templating System

Replies are listed 'Best First'.
I'd agree -- know your audience.
by jhourcle (Prior) on Mar 02, 2005 at 04:01 UTC

    Each templating system / text pre-processor, or whatever is intended for a particular audience. You have to analyze what functionality you're going to need, and who is going to be using it.

    If you can take care of 99% of your site with a CMS system that requires no technical, and leave the last 1% to someone with some programming skills, it's probably better than giving them something they can accidentally break.

    For instance, back in my undergrad days, the group I worked for did a web page that called an SSI for the bulk of its content. Unfortunately, the site's 'owner' kept editing the page in a WYSIWIG editor which pulled down its content through HTTP ... I tried leaving a hint, but as they never looked at the source, they never found my not-so-subtle hint.

    My advise, if you're going to be the only one using it, is to take a look at the syntax, and see if it makes sense to you. If it does, then you're probably fine -- but if the maintainer has a different mindset than you do, you might want to look at something else.

    If whoever is developing content has absolutely no programming skills at all, and you're not dealing with database backends and the like, you might also take a look at Markdown.

      Your not-so-subtle hint was hilarious. :-) Thanks for sharing that. It's a shame that the guy didn't see it... and I love that it was picked up by archive.org.
Re^3: Advice Choosing a Templating System
by cowboy (Friar) on Mar 02, 2005 at 07:18 UTC
    True. Although in my (limited) experience, I've found that generally, teaching the people who do design anything to do with languages, mini, or not, seems to be a crap shoot. Either they can grasp the concept, or they can't.

    If they can, mason, or template toolkit, or any other comes easy enough. They can include a header/footer, call another block of code in a loop, without having to be 'programmers', after a simple example or two.

    If they cannot, it doesn't seem to matter if the template is as simple as:
    <title>%%title%%</title>
    they can't seem to understand that we'll put the proper value there.

      If that's the case, then maybe Petal is the templating system to use - the templating information is secretly kept in attributes, so the designers can move around the tags to their liking, and fill it with sample data as much as they want. This might give them a more concrete grip on things.