I have two auto slots that load a series of slides for a slider. I use a generic Auto Slot called ‘SlotAuto’ and call it with different sets of parameters. This worked when i set the parameters in the bindings, but I had to move the $modday out of the bindings because it threw an error when I tried to set it in the bindings.
The first auto slot has the parameters defined in the bindings. But then I need to set a second set of parameters in the code and call the second slot. But I think I am missing the code I need to reinitialize the slot with new parameters and can’t seem to find an code example of how to do this. When I run the code, the second slot just outputs the first slot parameters again.
Why would the second slot display the same query as the first slot even though I have given it a new set of parameters? Do I need to call the slot a different way or does it need to be initialized in some way?
I’m not sure what the problem is, but I can tell you what I’d look at:
Since both slot calls are using the same slot ‘SlotAuto,’ I’d confirm that its slot finder does not have a hard-coded query string defined in its ‘query’ parameter.
I’d try zeroing out all param values immediately after each slot call, and explicitly setting slot param values immediately prior to each slot call, to be sure there are no unintended values passed. On a previous project, we used the same name ($slotparams) on any template using a slot. We’d set only one $slotparams parameter value on the template’s Bindings tab to init the map (often “$slotparams.template”), and set all other param values in the template source - following our coding standard to zero out values in the lines imm. after each/any slot call.
Finally, we used the following technique we found on these forums where the $more variable was never used but was necessary part of setting a new binding value passed in to a template.
## Set parameter 'more' so that ##
## the next template will know to render the "See More" link ##
#set($more = $sys.assemblyItem.bindings.put('$more', "1"))
#slot("slotFeatureItems" "<div class='inset-feature-items'>" "" "" "</div><div class='clearfix'></div>" $slotparams)
## Set $more back to 0 (zero) to prevent legacy values from trickling through when they shouldn't ##
#set($more = $sys.assemblyItem.bindings.put('$more', "0"))