getting data from a block inside another block using the locator tool
#set ($navigation = $_.locateBlock(${navlocation}, $currentPageSiteName))
#set ($navtype = $navigation.getStructuredDataNode("navtype").textValue)##
#if($navtype == "Links")
#set ($links = $navigation.getStructuredDataNodes("link"))##
#else
#set ($navmirror = $navigation.getStructuredDataNode("navmirror"))##
#end
$navmirror
is the block inside the block and gives
me:
com.hannonhill.cascade.api.adapters.StructuredDataNodeAPIAdapter@277dd574
and the below does NOT work:
#set ($navmirrorpath = $navmirror.getStructuredDataNode("path").textValue)##
#set ($navmirrorsite = $navmirror.getChild("site").textValue)##
all help is appreciated, thanks!
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on 06 Jun, 2016 12:08 PM
Hi Nando,
You will need to use the
asset
property in order to access the data for the chosen asset itself. For example:Also,
$navmirror.getChild("site").textValue
will most likely not work becausegetChild
is a method used for XML elements and not API objects. Instead, you would go with something like$navmirror.siteId
or$navmirror.siteName
.If you are unsure of what properties and methods are available for a given object, use the $_PropertyTool.outputProperties method.
Please let me know if you have any questions.
Thanks!
2 Posted by Nando on 07 Jun, 2016 12:52 PM
Thanks Ryan! Wing helped me out as well on a 1 on 1 - you guys are awesome!
Nando closed this discussion on 07 Jun, 2016 12:52 PM.