Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find out the navigation level?
#4
If you want to access $parent from inside your function, you’re going to have to access the global:
Code:
function yourfunction() {
   global $parent;
   if (isset($parent)&&strlen(trim($parent))>0) {
      // When this page has a parent.
   } else {
      // When this page is on the top-level.
   }
}
To get the URL you can use the find_url function. This also takes care of the users settings like Fancy URLs.
Code:
$parentlink = find_url($parent);
I’m afraid there is no way at the moment to just get the title. You will have to open the XML data file and check the name inside your script.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply


Messages In This Thread
Find out the navigation level? - by media-seven - 2010-10-06, 19:10:09
Find out the navigation level? - by Zegnåt - 2010-10-06, 20:11:42
Find out the navigation level? - by media-seven - 2010-10-06, 20:33:24
Find out the navigation level? - by Zegnåt - 2010-10-07, 01:04:31
Find out the navigation level? - by media-seven - 2010-10-07, 16:21:03
Find out the navigation level? - by Zegnåt - 2010-10-07, 16:54:20
Find out the navigation level? - by media-seven - 2010-10-07, 17:10:00
Find out the navigation level? - by Zegnåt - 2010-10-07, 18:32:45



Users browsing this thread: 1 Guest(s)