Hi everyone: I’ve been publishing with Percussion for about a year, but it’s a very small portion of the development I do, and until now we’ve done fairly basic flat publishing within the site. We now have occasion to do some dynamic, tag-based publishing, which I’ve attempted to set up with an auto slot. I can’t quite get it all working, and I wanted to see if anyone could point me in the right direction. I’ll briefly describe my set-up:
I’m trying to automatically publish some podcasts from a nested directory to a multimedia page that contains a few other elements. I have created a “Dynamic Index” content_type (note: I’m using generic names in this post to make things easier to follow). This is for the overall page and utilizes basic fields like title, body, etc.; nothing to it. It uses a “Dynamic Page” template by default. This template echoes out the title, body, etc, and then calls in an “AutoQuery” slot. My "AutoQuery slot uses “sys_RelationshipContentFinder” as its content finder. It allows for an “AutoIndex” content_type, and a “Podcast Link” template. (this is where I get fuzzy, but it seems to be how things are documented.)
My “AutoIndex” content_type contains a “query” attribute which points at a keyword query. This keyword query contains a number of Label-Value pairs displayed in single-select dropdown. The values correspond to JSR queries that return various sets of content_items … in this particular case, a list of podcasts. I have tested the query out in the Rhythmyx query tester, and I can confirm it returns a couple podcast items.
In my “Dynamic Page” template, I use the following code to call in the slot:
#slot(“AutoIndex”, “” “” “” “” “template=Podcast Link”).
So, I create a content_item called “Index” of the “Dynamic Index” type … give it a title, body, etc. In Active Assembly, I then insert another content_item I’ve created of the “AutoIndex” type, which simply selects the podcast query among its options.
My question is this … how and where do I define the behavior to loop over the returned items in the query? In my “Podcast Link” template, all I can seem to echo out successfully is the name the content_item that contains the query, not the query results. I’ve seen various idioms in documentation such as …
#foreach($relresult in $sys.currentslot.relresults) … but this isn’t working for me. $relresult seems to be empty or null when I do this in the “Podcast Link” template.
I apologize for this long question, and I hope it makes sense to someone. I feel like I’m pretty close, but I don’t have everything connected in just the right way. Any help would be vastly appreciated.