Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
tpl
System
Hi,
I have a query regarding tpl.There is one item in a dct called "name ".Now in 1 tpl i have to check the value of this item and depends upon this value i have to call other tpl's.For example if the value is "a" then i have to call presentation1.tpl and if it is "b" then presentation2.tpl.I have tried the following code but it is not working properly.Can anyone check this code and suggest a solution.
<?xml version ="1.0" encoding="UTF-8"?>
<iw_pt name="Test">
<iw_perl>
<iw_if expn='{iw_value name=dcr.ProductCatalogue.Products.name"/} eq "a"'>
<iw_then>
<iw_include file='templatedata/Datatype/presentation/presenation1.tpl'/>
</iw_then>
<iw_else>
<iw_include file='templatedata/Datatype/presentation/presentation2.tpl'/>
</iw_else>
</iw_if>
</iw_perl>
</iw_pt>
Find more posts tagged with
Comments
Adam Stoller
Are all the PTs in the same data-type/category/presentation directory? The same as the main PT?
If so - I *think* you just want to use the PT name and not the area-relative path to the PT - otherwise I think you have to set the 'mode' attribute correctly for the type of path you're using.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
jbonifaci
Try changing file= to pt=. Also, in regards to fish's comments, the path from templatedata on should be fine.
~Jeff
Migrateduser
Hi,
I have made some changes in my previous code.All pts are in same path as main pt.Still I am not getting the desired output.When I click the preview button I am getting some error called "broken pipe erroe.File was not generated".Can anyone help me to solve this?
<?xml version ="1.0" encoding="UTF-8"?>
<iw_pt name="Test">
<iw_ostream>
<iw_perl>
<iw_if expn='{iw_value name=dcr.Catalogue.Products.name"/} eq "sony"'>
<iw_then>
<iw_include pt=p1.tpl' mode='ptlocal'/>
</iw_then>
<iw_else>
<iw_include pt='p2.tpl' mode='ptlocal'/>
</iw_else>
</iw_if>
</iw_perl>
</iw_ostream>
</iw_pt>
Adam Stoller
have you tried debugging the PTs using iwpt_compile.ipl with the '-ocode' flag? If not, I'd suggest you do because that has a good chance of uncovering the problem.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Prashanth Shetty
In
<iw_include pt=p1.tpl' mode='ptlocal'/> single quotation is missing.
it should be <iw_include pt='p1.tpl' mode='ptlocal'/>