Gossamer Forum
Home : Products : Gossamer Links : Discussions :

<%variable%> inside <%variable%>

Quote Reply
<%variable%> inside <%variable%>
hi wants to know how do I use <%variable%> in <%variable%>

means I have golbal function name <%test%> which prints <%test2%> results.

can it be done... I tried & I got result in html as <%test2%> as it is.

example:-
results from <%test2%> is xyz
so I call <%test%> in my links template & <%test%> replace value with xyz (which it got from <%test2%>


Thanks!

Last edited by:

jasy007: Mar 20, 2006, 11:52 AM
Quote Reply
Re: [jasy007] <%variable%> inside <%variable%> In reply to
You can call GT::Template->tags in your test global. tags returns the available tags in the template. So you can do something like:
Code:
my $tags = GT::Template->tags;
print $tags->{test2};

Adrian
Quote Reply
Re: [brewt] <%variable%> inside <%variable%> In reply to
cool, that was helpful.... although I end up merging test1 & test2 code in single tag. maybe next time I will use your trick Smile