in reply to Survey of Surveys on HTML Templating systems
Example:
Welcome back <b tal:content="user/name">Sample Username</b>, you last logged in <i tal:content="user/last_login">Sat 23rd Aug</i>
When you look at this in dreamweaver or a browser you'll see
Welcome back Sample Username, you last logged in Sat 23rd Aug
(view source on this page and you'll see that I have simply pasted in the code)
When you run this through the Petal engine you pass in a hash of data, say $h. Assuming
The processed output will be$h = { user => { name => "Fergal Daly" last_login => "Feb 22nd" } }
Welcome back Fergal Daly, you last logged in Feb 22nd
As you can see, the HTML beforehand is well formed, includes sample values for the dynamic parts and all you have to do with Dream weaver is apply styles to the sample data and all will be well. At template compile time, all the sample data is discarded and then at run time, the real data is inserted.
Of course TAL handles loops and conditionals etc. The thing that takes the most getting used to is that it's a little verbose. Unfortunately this is a necessary side effect of being truly compatible with XML/HTML.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Survey of Surveys on HTML Templating systems
by metaperl (Curate) on Feb 23, 2005 at 22:02 UTC | |
by fergal (Chaplain) on Feb 23, 2005 at 22:34 UTC | |
by metaperl (Curate) on Feb 23, 2005 at 22:51 UTC | |
by fergal (Chaplain) on Feb 24, 2005 at 01:42 UTC | |
by metaperl (Curate) on Feb 24, 2005 at 20:14 UTC | |
| |
Re^2: Survey of Surveys on HTML Templating systems
by perrin (Chancellor) on Feb 23, 2005 at 20:28 UTC |