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

Re: template toolkit question -- metadata

by Tomte (Priest)
on May 11, 2007 at 08:27 UTC ( #614845=note: print w/replies, xml ) Need Help??


in reply to template toolkit question -- metadata

The TT2 documentation says:

The META directive allows simple metadata items to be defined within a template. These are evaluated when the template is parsed
That means that the last value assigned to a META item will 'win', so to speak, as the conditional can't be and isn't evaluated during parse-time - change the order of the conditional, and the title should always display "BOOK".

Edit: I experimented a bit with the following template

[% SET type = "D" %] [% IF type == 'B'; META title = 'Book'; ELSIF type == 'D'; META title = 'DVD'; ELSE; META title = 'CD'; END; -%] - [% template.title %] / [% type %] / [% template.name %] / [% templa +te.modtime %] - [% META title = 'LAST' %]
and ttree to test my hypothesis, and I seem to interpret the documentation correctly:
- LAST / D / test.tt2 / 1178881986 -

regards,
tomte


An intellectual is someone whose mind watches itself.
-- Albert Camus

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://614845]
help
Chatterbox?
[Lady_Aleena]: atcroft, I"m trying to think of a module I've used that linked to another module.
[Lady_Aleena]: atcroft, I just put a link to another module in one of my local ones. For a normal link L<text|url> the text would be written out then the url would follow the text in brackets <>. However, when I linked to another module, the text was written ..
[Lady_Aleena]: ... but no link. L<module name> might localize to where ever it is, like PerlMonks [id://1026423] does. (Cookies)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2017-05-27 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?