Could you calculate the variable with function stored in a perl module, rather than with an included tpl. Then you can call the function from main.tpl. If you still need to include the other tpl, and if that tpl needs the value to, then pass the value from main.tpl to included.tpl ?Alternatively, it may be possible to pass a scalar or hash reference from main.tpl to included.tpl. The doc at http://your_teamsite_servername/iw/help/tst/pt/TeamSite__PT__iw_include.html seems to suggest that, but I've never done it.
Hi,I need to pass value of perl variable from included tpl to main tpl.I read the document on iw_include. Now I am calling A.tpl in Main.tpl like this:<iw_include pt='A.tpl' mode='ptlocal' loc_param_val='$locale' />and using the value of passed perl variable in Main.tpl like this: <iw_value name='$iw_arg{loc}'/>But this also does not help. My requirement is to call a tpl file so suggest me on that line.-Thanks,Retesh
my $locale = q(UNKNOWN);
our $locale = q(UNKNOWN);
I don't believe you understood what Frederik was saying. The documentation at /iw/help/tst/pt/TeamSite__PT__iw_include.html clearly shows how to pass a variable to an included tpl. If that variable happens to be a reference, the included tpl could theoretically modify that value and then the main tpl would receive that modification.This would appear to be the only way to send something from an included tpl back to a parent tpl.I have never tried this though, so the real question is, has the main tpl finished processing prior to the call to the included tpl? If so, even though the main tpl would technically have access to the modified reference value, it would be useless, as it would not be modified until the main tpl has finished its own processing.If this is true, then I don't see how one would ever pass anything back to a main/parent tpl.Try passing the variable by reference instead of by value and see what happens. If the answer is nothing, then this is likely not possible.~Jeff
Local Variable Message Value Before Include CallLocal Variable Message Value Set In Include TPL
iw_include pt='Include.tpl' mode='ptlocal' message_param_val='(\$localMessageVariable )'
message_param_val='(\$localMessageVariable )'
message_param_val='($localMessageVariable )'
\\
\
I believe Jeff's post has been messed up by this forum's funky parsing The notification email I received had this:above in his post, the message_param_val='(\$localMessageVariable )' has become message_param_val='($localMessageVariable )'.That's the difference between passing by reference (which should allow Include.tpl to re-assign another value) or passing by value.about the forum's parsing: The backslash inside an HTML block must be doubled, in order to appear once: write \\, see \ So retesh, just try again the example of Jeff
Good catch, I've updated my post. I'm not a big fan of the code/html posting abilities in this forum software.~Jeff
Yea and when you miss-hit the golf ball, I am sure it is the club's fault as well.