I have a content type which is based on the NavOn. By this I mean that it has the same cloning and submenu nature of NavOns. I am trying to build a simple recursive slot call which will trace down the hierarchy through the submenu slots. It consists of two templates, both of which are pretty simple.
The first template is the page template which is used to start the recursion when called on one of these content items.
Page Template:
#set ($contentslot = "rffCategorySubMenu")
#slot($contentslot "<div class='cmenu'>" "" "" "</div>" "template=xilTpSnCategorySupportListRecurse")
The snippet template called from the slot:
#set($slotname = "rffCategorySubmenu")
<div class='topcat'><a href='$link' class='catlink-cmenu'>$thisTitle</a>
#slot($slotname "<div class='cmenu'>" "" "" "</div>" "template=xilTpSnCategorySupportListRecurse")
</div>
The code works like a charm except that there is no way to denote in the code what “Level” each of these items are in the hierarchy.
The outputted page code looks like this:
<div class='cmenu'>
<div class='topcat'><a href='/support/documentation/fpga_device_families.htm' class='catlink-cmenu'>FPGA Device Families</a>
<div class='cmenu'>
<div class='topcat'><a href='/support/documentation/virtex-5.htm' class='catlink-cmenu'>Virtex-5</a>
<div class='cmenu'>
<div class='topcat'><a href='/support/documentation/virtex-5_data_sheets.htm' class='catlink-cmenu'>Virtex-5 FPGA Data Sheets</a>
</div>
</div>
</div>
</div>
</div>
</div>
The “level” is is important to the designer which is trying to use this outputted page in a JS function which creates a nifty navigation component.
What we need is a way to pass a param through the recursion. I have tried creating a new slot using the OOTB #slot macro as a template, but the additional value passed to the new macro (#recursion_slot) does not get passed through the $rx.doc.extractBody($relresult) call. So, the snippet template does not know the variable exists.
I tried passing the index value through the $params mechanism in the OOTB #slot macro, but that value is not found because the index param I created is not listed in the sys_RelationshipContentFinder as a valid param. I tried adding it to the valid param list, but that did not work either. I’m assuming this did not work because the underlying class (com.percussion.services.assembly.impl.finder.PSRelationshipSlotFinder) does not support new param values. I can’t find any information on the class (com.percussion.services.assembly.impl.finder.PSRelationshipSlotFinder) in the JavaDocs to find out what I might need to do to get the $param value passed through the slot call.
Any help would be greatly appreciated.
Thanks.
John