Still trying to figure out the locator tool

Ashley Williams's Avatar

Ashley Williams

21 Apr, 2014 01:14 PM

$contactLink is returning as null. It's from a page that's selected from an asset chooser. I'm not sure what I need to use in order to get the path for $contactLink. I'm also attaching my xml for $page.

#set ( $page = $_.locatePage($infoFile.getChild("path").value, $infoFile.getChild("site").value) )
#set ( $contactLink = $page.getStructuredDataNode("department-information/contact-us-page/path").textValue )
  1. 1 Posted by Ryan Griffith on 21 Apr, 2014 02:08 PM

    Ryan Griffith's Avatar

    Hi Ashley,

    You are very close. Because the field is a chooser, you would use the getStructuredDataNode method to obtain the chooser field itself and then use the Asset API to access the path property. When you have a moment, give the following a try and let me know how it works out:

    #set ( $page = $_.locatePage($infoFile.getChild("path").value, $infoFile.getChild("site").value) )
    #set ( $contactPage = $page.getStructuredDataNode("department-information/contact-us-page") )
    #set ( $contactLink = $contactPage.asset.path )
    

    If you would like to see additional properties and methods available to objects, you can use the Property Tool.

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by Ashley Williams on 28 Apr, 2014 01:16 PM

    Ashley Williams's Avatar

    That helps! Thank you.

  3. Ashley Williams closed this discussion on 28 Apr, 2014 01:16 PM.

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

 

26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM