Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Advice Choosing a Templating System

by cowboy (Friar)
on Mar 02, 2005 at 00:09 UTC ( [id://435661]=note: print w/replies, xml ) Need Help??


in reply to Advice Choosing a Templating System

I've used Mason on a couple of fairly large projects, and love it.
It's fairly quick to get up to speed on, uses perl, with a few special html-ish tags, includes a caching api built on Cache::Cache, and has quite a number of modules that extend the core system. (such as adding Apache::Session support)

I don't know enough about other systems, at least not any recent usage, but in my mind, the fact I don't have to learn a fancy mini-language for my templates, and just write them in perl, is a big plus.

Too many templating systems seem to have been written by people wanting to design a programming language, rather than a templating system.
  • Comment on Re: Advice Choosing a Templating System

Replies are listed 'Best First'.
Re^2: Advice Choosing a Templating System
by merlyn (Sage) on Mar 02, 2005 at 02:27 UTC
    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.

      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.
      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://435661]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-25 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found