Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find out the navigation level?
#5
Zegnåt Wrote: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.

Thank you very much!
I've got one problem now though. "find_url($parent)" results in my root path, no matter where I am.
And how do I open the XML data file? Couldn't find anything in the documentation about it.

Thanks again.
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)