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)
TS6.0 - test for replicant values
miletwo
I have templates created in TS 5.5.2 that no longer function correctly in TS6. The problem is, that test for replicant values now always return true when in-fact there are no values in the replicant.
Test for replicant example:
--------------------------------------------------------
<iw_if expr=' defined {iw_value name="dcr.content.procedures" /} ' >
<iw_then>
<![CDATA[<ul>]]>
<iw_iterate list='dcr.content.procedures' var='p'>
<![CDATA[<li>]]><![CDATA[<a href="{iw_value name='p.linkto'/}">{iw_value name='p.linktext'/}</a></li>]]>
</iw_iterate>
<![CDATA[</ul>]]>
</iw_then>
</iw_if>
--------------------------------------------------------
In this case the UL tag is printed even though there are no values.
any help is appreciated. Next step - open a case.
Jeremy Anderson
AmerisourceBergen Corporation
Find more posts tagged with
Comments
pflory
Jeremy,
I haven't looked into the release notes or done any research to see if this change was intended or not, but in the meantime, could you simply check for empty values?
For example:
<iw_if expr=' {iw_value name="dcr.location_image"/} ne "" '>
Paul Flory
pflory
OK - I didn't read your post carefully enough, and provided a useless response the first time around.
I still don't know if the behaviour has changed b/w TS versions, but here's something that works in 6.1.
Assuming you have something like this in the DCT:
<container name="links" min="0" max="999" >
<label>Links</label>
<description>Links</description>
<item name="link" rowcontinue="t">
<label>Link</label>
<description>Link</description>
<text size="50" />
</item>
The following in your .tpl will check if there is *something* in the container:
<iw_if expr='! {iw_value name="dcr.links.link" /} ' >
<iw_then>
Nothing here!!!!
</iw_then>
</iw_if>
Let me know if that works.
Paul Flory
miletwo
That worked. Odd that defined() would return true but the value return null or false.
WHATEVER!
Thanks for your help. Much appreciated.
Jeremy