Discussion:
Looping Through Children Elements
Heather Napoleone
2017-02-06 20:15:51 UTC
Permalink
I have a page with a list element and would like to display each item in
that list and also display its children as subbullets in that list (see
below).



Main Page

-List item A

---Child list item 1

---Child list item 2

--List item B

---Child list item 1

---Child list item 2



Currently we can only access the total number of child list items using
this rendertag:

<%!! Context:Pages.GetPage(Guid[GUID OF LIST).Elements.GetElement([CHILD
LIST]).Value.Count !!%>


What we can’t do is loop through each child list item and pull elements
from it to display on the main page.
--
You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reddot-cms-users+***@googlegroups.com.
To post to this group, send email to reddot-cms-***@googlegroups.com.
Visit this group at https://groups.google.com/group/reddot-cms-users.
For more options, visit https://groups.google.com/d/optout.
Hilmar Bunjes
2017-02-07 15:18:47 UTC
Permalink
Heather,
you can iterate through multilinks list list and containers like this:

<ul>
<reddot:cms>
<foreach itemname="myItem"
object="Context:CurrentPage.Elements.GetElement(lst_pages).Value"
countername="counterVar">
<htmltext>
<li>
<%!! Store:myItem.Id !!%>, <%!! Store:myItem.GetUrl() !!%>, <%!!
Store:myItem.Headline !!%>
</li>
</htmltext>
</foreach>
</reddot:cms>
</ul>

HTH,
Hilmar
Post by Heather Napoleone
I have a page with a list element and would like to display each item in
that list and also display its children as subbullets in that list (see
below).
Main Page
-List item A
---Child list item 1
---Child list item 2
--List item B
---Child list item 1
---Child list item 2
Currently we can only access the total number of child list items using
<%!! Context:Pages.GetPage(Guid[GUID OF LIST).Elements.GetElement([CHILD
LIST]).Value.Count !!%>
What we can’t do is loop through each child list item and pull elements
from it to display on the main page.
--
You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reddot-cms-users+***@googlegroups.com.
To post to this group, send email to reddot-cms-***@googlegroups.com.
Visit this group at https://groups.google.com/group/reddot-cms-users.
For more options, visit https://groups.google.com/d/optout.
Loading...