2010-10-07, 01:04:31
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.
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:
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.
}
}
Code:
$parentlink = find_url($parent);
“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!
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!