Locator Tool and getting the current attribute

Ashley Williams's Avatar

Ashley Williams

25 Feb, 2016 05:56 PM

Hello! What is the best method to get the value of the current attribute on a page using the locator tool? I've tried this but it doesn't seem to be working.

#set ( $currentPage = $_.locatePage($currentPagePath) )

Any help is appreciated. Thanks!

  1. 1 Posted by Wing Ming Chan on 25 Feb, 2016 06:42 PM

    Wing Ming Chan's Avatar

    Hi, Ashley,

    What exactly are you trying to do? When you use the Locator Tool, there is no current attribute available. In fact, you are not dealing with XML at all, and there are no attributes to look at.

    One more thing. The global variable $currentPage already points to the current page. There is no point in using locatePage at all.

    For more information, see Lesson 8: $_DateTool and $_


  2. 2 Posted by Ashley Williams on 03 Mar, 2016 04:12 PM

    Ashley Williams's Avatar

    Hi Wing,

    Sorry for not replying sooner. I was trying to check the current page's path against the path of a link I was setting up in a list. If they matched then I'd set a class to highlight the link. I ended up using

    #set ( $pagepath = $currentPagePath)
    which seems to work for my purposes. Thank you for your help!
  3. Ryan Griffith closed this discussion on 03 Mar, 2016 09:52 PM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts


? 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