Question

Photo of Kjell Nygren

0

The way to loop child content

Edit: I've come up with this which appears to do the job. I figured if I pounded at it for a while, I'd figure something out. Is this the way?

https://codeshare.io/gLg6Xn

I'm assuming I need to nest "for" statements. I have a few places I'd like to do this. But to start, let's take a sermon series as an example.

Sermon series has 3 sermons listed as children, and 3 resource urls listed as children to the series. Each sermon linked as a child has content to reference as well (notes, title, etc). I want it all listed in a single block. Imagie each series was a card containing the series details on the top, and the sermon content would be cycled through. It would structurally look something like this:

+ Sermon Series A

|__ Series graphic and title

|__ Series Resources

      + Sermon 1

       |___ Sermon Title

       |___ Sermon Video Link

       |___ Sermon Notes

      + Sermon 2

       |___ Sermon Title

       |___ Sermon Video Lin

       |___ Sermon Notes

+ Sermon Series B

. . . etc.

I want to reduce the the number of clicks that it takes someone to get to the content they're looking for. In the stock external theme (and ours) click on watch, click on series, click on sermon, click play. It's a lot of friction.

If anyone can point me to the documentation or another resource that discusses referencing child content so I can learn for myself, I'm cool with that. Or if there's something fundamental that I'm missing, set me straight. Any help is appreciated.

  • Photo of Brent Pirolli

    1

    I'm assuming you've probably already seen the documentation on content channels here: https://community.rockrms.com/Rock/BookContent/14#contentchannels

    You CAN reference child content items. Look at our Daily Devotional we publish. The main page with a Content Channel (we called it "Collections"): https://livingitout.cedarcreek.tv/

    If you look at the Devotional, this is a Content Channel Item (we called it "2023 Daily Devotional"): https://livingitout.cedarcreek.tv/collections/2023-daily-devotional

    And each daily post is a Child Item of that Content Channel Item... such as today's: https://livingitout.cedarcreek.tv/collections/studies/stop-trying-and-start-trusting

    On the https://livingitout.cedarcreek.tv/collections/2023-daily-devotional page you'll see we have a "Content Channel Item View" block which is of course pulling up the Content Channel "2023 Daily Devotional" but you'll also see we show the most recent 6 Child Items.

    The block code: https://pastebin.com/rrQSCPpj

    You'll see around line 62 we are starting to reference child items. Line 74, 81, 82... should show how we are pulling some of that data into this page. Hope this helps!

    • Kjell Nygren

      Perfect. I intuited this from looking at a few other pages, but I was concerned that I might be implementing some deprecated or legacy code.