2010-10-07, 16:21:03
Zegnåt Wrote:If you want to access $parent from inside your function, you’re going to have to access the global:
To get the URL you can use the find_url function. This also takes care of the users settings like Fancy URLs.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.
}
}
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.Code:$parentlink = find_url($parent);
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.