Is it possible to get the contentID(s) of the items in a slot in the bindings area?
Is using ‘$sys.asm.findSlotByName(“Slot_Name”)’ going the right way for getting it?
Thanks!
Is it possible to get the contentID(s) of the items in a slot in the bindings area?
Is using ‘$sys.asm.findSlotByName(“Slot_Name”)’ going the right way for getting it?
Thanks!
Use the $user.PSOSlotTools.getSlotContents() method in the PSO Toolkit. This will return a List of items, and you can get the sys_contentid property from each item.
Thanks! Can you point me at any documentation for its usage?
The formal documentation is in the PSOToolkit Javadoc.
If you have installed the PSOToolkit properly on the server, go to:
http://myServer:9992/Rhythmyx/Docs/Rhythmyx/PSOToolkit/index.html
However, you will probably find the answer in this thread (or one like it):
http://forum.percussion.com/showthread.php?t=1900
Dave
Jay,
Here’s an example from the bindings one of our templates - just to give you something to cut and paste
We get two fields from the slot item: displaytitle and webinar_description. You could change the field name to “rx:sys_contentid” to get the content ID.
Variable Binding
-----------------------------------------------
$slotparams.template "mwWebinar_EmailHTML"
$parent_webinar $user.psoSlotTools.getSlotContents($sys.assemblyItem,"mwWebinarSlot", $slotparams).get(0).getNode()
$webinar_title if ($parent_webinar == ""){"";} else {$parent_webinar.getProperty("rx:displaytitle").String;}
$webinar_description if ($parent_webinar == ""){"";} else {$parent_webinar.getProperty("rx:webinar_description").String;}