Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
iterate containers?
nico
How can I get a tpl to iterate through a containers values until there is no more to read?
The below code returns the value of the initial "archiveyear.newsrelease" values based on the if/then however if there is more than one "archiveyear" it will not display the value of the remaining "archiveyear"'s it will only display the value of the first container.
I may have coded myself into a corner as my content contributors have entered lots of iterated content already so changes to the dcr would delete their work since I know surrounding the Archiveyear parent container with a new parent would most likely solve this but i'm hoping there are other ooptions.
ts672sp2 win
See my code below:
DCR
[PHP]
Archive Year
News Release
Title
Link
Date
Intro
<br /><br />
Thumbnail
[/PHP]
TPL
[PHP]
[size=2][color=#0000ff]
[/color][/size]
[size=2][color=#a31515]xml
[/color][/size]
[size=2][color=#0000ff]
[/color][/size]
[size=2][color=#ff0000]version
[/color][/size]
[size=2][color=#0000ff]=
[/color][/size]
"
[size=2][color=#0000ff]1.0
[/color][/size]
"
[size=2][color=#0000ff]
[/color][/size]
[size=2][color=#ff0000]encoding
[/color][/size]
[size=2][color=#0000ff]=
[/color][/size]
"
[size=2][color=#0000ff]iso-8859-1
[/color][/size]
"
[size=2][color=#0000ff]?>
<
[/color][/size]
[size=2][color=#a31515]iw_pt
[/color][/size]
[size=2][color=#0000ff]
[/color][/size]
[size=2][color=#ff0000]name
[/color][/size]
[size=2][color=#0000ff]=
[/color][/size]
"
[size=2][color=#0000ff]ir
[/color][/size]
"
[size=2][color=#0000ff]>
<br><br></font></font>[/color][/size]<font size=2><font color=#808080>[size=2][color=#808080]<section id="newsSidebar"><br><br><h1><br><br><a href="/about/news/releases/default.aspx">Recent News</a><br><br></h1></font></font>[/color][/size]<font size=2><font color=#0000ff>[size=2][color=#0000ff]
<
[/color][/size]
[size=2][color=#a31515]iw_iterate
[/color][/size]
[size=2][color=#0000ff]
[/color][/size]
[size=2][color=#ff0000]var
[/color][/size]
[size=2][color=#0000ff]=
[/color][/size]
'
[size=2][color=#0000ff]mod
[/color][/size]
'
[size=2][color=#0000ff]
[/color][/size]
[size=2][color=#ff0000]list
[/color][/size]
[size=2][color=#0000ff]=
[/color][/size]
'
[size=2][color=#0000ff]dcr.archiveyear.newsrelease
[/color][/size]
'
[size=2][color=#0000ff]>
<
[/color][/size]
[size=2][color=#a31515]iw_if
[/color][/size]
[size=2][color=#0000ff]
[/color][/size]
[size=2][color=#ff0000]expr
[/color][/size]
[size=2][color=#0000ff]=
[/color][/size]
'
[size=2][color=#0000ff]{iw_value name="mod.thing"/} eq "thing"
[/color][/size]
'
[size=2][color=#0000ff]>
<
[/color][/size]
[size=2][color=#a31515]iw_then
[/color][/size]
[size=2][color=#0000ff]>
</font></font>[/color][/size]<font size=2><font color=#808080>[size=2][color=#808080]<article><a href="{iw_value name='mod.link'/}"><h2><iw_value name='mod.title'/></h2></a></article></font></font>[/color][/size]<font size=2><font color=#0000ff>[size=2][color=#0000ff]
[/color][/size]
[size=2][color=#a31515]iw_then
[/color][/size]
[size=2][color=#0000ff]>
[/color][/size]
[size=2][color=#a31515]iw_if
[/color][/size]
[size=2][color=#0000ff]>
[/color][/size]
[size=2][color=#a31515]iw_iterate
[/color][/size]
[size=2][color=#0000ff]>
</font></font>[/color][/size]<font size=2><font color=#808080>[size=2][color=#808080]</section></font></font>[/color][/size]<font size=2><font color=#0000ff>[size=2][color=#0000ff]
[/color][/size]
[size=2][color=#a31515]iw_pt
[/color][/size]
[size=2][color=#0000ff]>
[/color][/size][/PHP]
Find more posts tagged with
Comments
Rick Poulin
Use nested iw_iterate loops, where the outer loops on year and the inner loops on newsrelease.
Calendar By Month Day View.png
CalendarReport Year__cwong.rptdesign
neeraj_kumar
You need to use nested iw_iterate.
You can take reference from
http://cms.ucc.usyd.edu.au/iw/help/tst/pt/TeamSite__PT__iw_iterate.html
here you will find a good example as well.