Developer forum

Forum » Templates » List paragraphs from childpages

List paragraphs from childpages

Kasper Skov
Reply

Hi. I'm new to DW.

I'm trying to create a template for a gallery. Under the gallery page I have multiple subpages (items) representing gallery categories. On the category items I have multiple paragraphs (gallery modules) representing the specific gallery.

I would like to list the specific gallery content divided into categories on the main gallery page.

Pseudo code with ItemPublisher: 

//Loop through categories and display category name

 foreach (LoopItem i in GetLoop("ItemPublisher:Items.List")){
                   <p>@i.GetValue("ItemPublisher:Item.Name")</p>
                   
                   <div >

                       //Loop through all paragraphs
                       @foreach (LoopItem i2 in i.GetLoop("ItemPublisher:Item.Paragraphs"))

                       {
                           @i2.GetValue("Gallery:Content")
                       }
                   </div>
               }

I attached a picture of the content structure. Please let me know if I got it all wrong.

Untitled-1.jpg

Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

You cannot do that...

Best thing I can come up with is using global paragraph on your main page.

Nicolai

Votes for this answer: 1

 

You must be logged in to post in the forum