Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
TeamSite
TeamSite, LiveSite and OpenDeploy
Passing Variable to Component template
System
If I have a Master template(topic_list_mct.tpl) that calls a perl variable:
my $spotltThere = iwpt_dcr_value("dcr.topicListDetail.spotlightInfo.spotlightWithLinksDCR");
and I want to use this variable in a compopnent .tpl of this master. Then how would I do it? This is the way the component .tpl is called from the master .tpl
<iw_perl>
# Getting the list of link DCR and TPL values from the Master List of Links DCR
my $listoflinksTplPath=iwpt_dcr_value('dcr.topicListDetail.listOfLinksTPL');
my $listoflinksDcrPath=iwpt_dcr_value('dcr.topicListDetail.listOfLinksDCR');
# Appending Base Path to the Spotlight DCR and TPL files.
$listoflinksDcrPath = $basePath.$listoflinksDcrPath;
$listoflinksTplPath= $basePath.$listoflinksTplPath;
# Getting the HTML Output of the List Of Links
my $listoflinksHTML = NewCo::NewCo_Generation::getTPLOutput($listoflinksDcrPath,$listoflinksTplPath);
</iw_perl>
<iw_value name="$listoflinksHTML"/>
I want to do a conditional thing in my one component based on whether another component is loaded/exists. I have seen some examples with $iw_arg and & $iw_param but always wrapped inbetween the <iw_clude> tags which isn't the way the component .tpl is being included in the master templates! See attached 2 templates. Any help would be useful!
-Thanks!
P.S. I've attached the two .tpl files involved ( into one sample file clearly separated). I want to be able to read the $spotitthere var from the master .tpl (topic_list_mct.tpl) in the component .tpl (list_of links.tpl)
Find more posts tagged with
Comments
There are no comments yet