Display system page title of current page
How do I display the system page title of my current page?
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 Charlie Holder on Apr 05, 2012 @ 02:40 PM
Hi pinaydriver --
Where are you looking to output this information? There are a few different methods depending how how you're looking to do it.
There are Metadata Tags that can be used in Templates, Formats, and WYSIWYGs.
There are some things to note in each case though.
Template: The tags cannot be used INSIDE of an XHTML tag attribute.
Formats: If you want to use one of the
<system-page->
tags you'll want to be 100% sure that there is only 1system-page
XML node to choose from. So depending on what Block you're paring it with you'll need to make sure that is handled correctly.WYSIWYG: You'll want to use the brace notation to the right of the tags and type it directly into the WYSIWYG and not the HTML source view.
Check out this comment as well for more information about how to get the current page's information into a Block.
Let me know if there's anything else!
Thanks.
2 Posted by pinaydiver on Apr 05, 2012 @ 02:57 PM
Hi Charlie,
Currently working on site navigation. I want to show the title of the page I am currently in including its children nodes. I am running a script initially to show the current folder with page title but not working.
3 Posted by Charlie Holder on Apr 05, 2012 @ 03:07 PM
There are a few things wrong with this script in order to pull the current data, but you're very close.
First, the
.selectNodes()
method will select multiple nodes (if available) that meet the criteria in the XPath statement. It will return a list and not just a single XML element reference. So currently your$folders
variable is a list and not a reference to the folder that contains the current page. One of the items in the list is that folder, but you can't just reference the variable. For this particular case I would recommend using the.selectSingleNode()
method instead. It looks like you just want to select the 1 folder and not (potentially) a bunch of folders.Second, your XPath statement might be a little off. The conditions that you've supplied are looking good, but I'm not 100% on the spaces. When you apply a condition, the set of square brackets, you'll want to bud those right up against the XML node you want the condition to apply to. So change your XPath to be this to be safe:
Third, when pulling the Title of a Page or Folder, it's important to realize that they could have typed ANYTHING in for that text field. When trying to display data from a text field, you'll want to escape it and make sure that exactly what they typed is rendered. If they typed a greater than sign, we don't want it to accidentally be interpreted from the browser processor as HTML code. Depending on what version of Cascade you're running I would use $_EscapeTool.xml() if you're using Cascade 6.10+ or $_SerializerTool.serialize() for all lesser releases.
Hope this helps. Let me know!
4 Posted by pinaydiver on Apr 05, 2012 @ 05:18 PM
Thank you for your help. You may now close this discussion.
5 Posted by Charlie Holder on Apr 05, 2012 @ 05:36 PM
No problem. If anything else comes up related to this feel free to just reopen!
Charlie Holder closed this discussion on Apr 05, 2012 @ 05:36 PM.