Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Learning Template::Toolkit - have I understood?

by Asim (Hermit)
on Aug 30, 2006 at 14:57 UTC ( [id://570397]=note: print w/replies, xml ) Need Help??


in reply to Re: Learning Template::Toolkit - have I understood?
in thread Learning Template::Toolkit - have I understood?

I like the idea of pre-generation of static html pages for the clarity, the server load.

You might consider Template caching (see "Caching and Compiling Options") as a easy solution for that issue.

To my mind, this seems a little backwards, since a large template-driven site is rarely going to be the first case, and much more commonly going to be the second case. No?

If you're converting to TT from a HTML-only design, yes, it's backwards. And that's not something TT was designed for; it's mostly built for ground-up design with TT in mind.

So, first off, you can indicate that TT "scoop up" .html files, or any other content. The INCLUDE_PATH option will contain a list of directories to look in, and you can write a quickie "generator" for it to recurse through your directory structure if you'd like, or manually list the directories; it's your choice. Make a "base" template, use the WRAPPER option, and then the "sub-templates" with the content get slugged in via the [% content %] tag. I strongly recommend skimming the various parts of the Template Manual; there is a LOT of power to the Template Toolkit that's not obvious, and it not "typical usage", as you've surmised.

Does that help?

----Asim, known to some as Woodrow.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found