okie for some weird reason I cannot seem to figure this out… Maybe the simple fact that it is midnight and that I am looking at code on a friday night is the real issue here.
Anyway I am building a snippet to generate a list of item for an accordion list. I am using the raw slot to do so so that I can count the items in the slot (ie nb of items in my accordion list) and also to find the first item and define ids in the code so that I can expand and collapse correctly. That’s all good and I have no issues there.
However the items in my accordion list have a slot so that I can add an image. I somehow can’t seem to just call this child slot… Could anyone help? I am sure someone must have done this before (I cannot believed I haven’t done this before myself!).
Anyway here is the code as it stands
#initslot("AccordionItem" "") #if($sys.currentslot.relresults.size() > 0) <div class="accordion" id="accordion2"> #foreach( $relresult in $sys.currentslot.relresults ) ## This will insure that only the first item of the accordion is expandanded, all other items with be collapsed #if($velocityCount==1)## #set($collapseClass="accordion-body collapse in")## #else #set($collapseClass="accordion-body collapse")## #end## <div class="accordion-group"> <div class="accordion-heading"> <a href="#collapse$velocityCount" data-parent="#accordion2" data-toggle="collapse" class="accordion-toggle"> <span class="number-collapse">$velocityCount</span>$relresult.getNode().getProperty('rx:displaytitle').String </a> </div> <div class="$collapseClass" id="collapse$velocityCount"> <div class="accordion-inner"> <div class="preview"> #slot_simple("Image") <p class="lead">$relresult.getNode().getProperty('rx:cllout').String</p> </div> </div> </div> </div> #end #end #endslot("AccordionItem")
So I am struggling to call the Image slot (represented in the code with a simple slot) I have tried using another nested Raw slot or a node slot but without success.
Any help greatly appreciated.