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.

Comments are currently closed for this discussion. You can start a new one.

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