Forum
pagelist enquiry
I understand this older add-on field type may be unsupported, but I'm currently trying to return the details for a parent page to use as a breadcrumb. The standard navigation system will not suffice as the user is picking a limited number of specific pages to be used as cameo links on the home page.
I can obtain the ID of the parent page using small modification to pagelist, but I'm lost trying to work out the rest:
$parent = $Page->pageParentID();
if (is_object($Page)) {
$store['pagePath'] = $Page->pagePath();
$store['pageTitle'] = $Page->pageTitle();
$store['pageNavText'] = $Page->pageNavText();
$store['id'] = $Page->id();
$store['pageSortPath'] = $Page->pageSortPath();
$store['pageThumb'] = $Page->pageThumb();
$store['colour'] = $Page->colour();
$store['description'] = $Page->description();
$store['pageParentID'] = 'ID: '.$parent;
$store['_default'] = $Page->pagePath();
}
Is it possible to obtain the pageNavText and pagePath of the parent from the parent ID and have it available to a pagelist content type?
Yes, you could use:
Thanks Drew, I'll take a look.
Hello Drew,
I've modified the code as follows:
However when trying to save I get the error message:
It refers to the line:
Any pointers would be appreciated.
Where is
$parent
defined?Just seen a potential fix, I'll give it a go and come back shortly...
Go there eventually... I needed the extra if statement for generating the parents values into the $store
Full working script: