Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Template Toolkit WRAPPER variations

by Anonymous Monk
on Sep 02, 2013 at 07:22 UTC ( #1051895=note: print w/replies, xml ) Need Help??


in reply to Template Toolkit WRAPPER variations

Question: Is their any way to make WRAPPER directive interpolate a variable?

Give it a $variable

[%# USAGE tpage --define news_id=all wrapper-macro.tt tpage wrapper-macro.tt -%] [%- BLOCK link -%] <a href="[% action | uri %]/[% newsitem | uri %]">[% content | html %] +</a> [%- END -%] [% SET vink = ( 1 < 2 ) ? 'link' : 'knil'; PROCESS $vink action = 'readnews' newsitem='some' content='Read +Some'; %] [% WRAPPER link action = "readnews" newsitem = news_id %] Read More ... [% END %]
$ tpage wrapper-macro.tt <a href="readnews/some">Read Some</a> <a href="readnews/"> Read More ... </a> $ tpage --define news_id=all wrapper-macro.tt <a href="readnews/some">Read Some</a> <a href="readnews/all"> Read More ... </a>

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1051895]
help
Chatterbox?
[1nickt]: pryrt yes, I see. There is no way to differentiate without forcing to a string and all sort of weird stuff. It is enough. User 42 can get creative if s/he wishes.
[chacham]: i sent him a private message expressing my displeasure.
[1nickt]: chacham It was worse than 2-1 ! almost 4-1 !
[jdporter]: Dang. No good example of how to use IPC::Run's run() in its simplest mode?
[LanX]: him or her! ;)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (15)
As of 2017-05-24 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?