Get the parent page full URL
Permalink 1 user found helpful
I want to create "UP" button (go one level back - like in next/prev block). In other posts i only find 5.6 solution.
I am her: home > blog > blog entry
In blog_entry.php i put this two lines:
The Result: /blog
I am her: home > blog > blog entry
In blog_entry.php i put this two lines:
<h1><!--parent link--> <?php $parent = Page::getByID($c->getCollectionParentID(), 'ACTIVE'); ?>; <?php echo $parent->getCollectionPath(); ?> </h1>
The Result: /blog
Thanks. How to use the API to see all of this methods?
http://documentation.concrete5.org/api/index.html...
http://documentation.concrete5.org/api/index.html...
@siton
In page templates, the current page object is available as the variable $c. In block templates, you can get the current page object using $c = Page::getCurrentPage();.
With the current page object, I believe you can use methods in classes like these:
http://documentation.concrete5.org/api/class-Concrete.Core.Page.Col...
http://documentation.concrete5.org/api/class-Concrete.Core.Page.Pag...
In page templates, the current page object is available as the variable $c. In block templates, you can get the current page object using $c = Page::getCurrentPage();.
With the current page object, I believe you can use methods in classes like these:
http://documentation.concrete5.org/api/class-Concrete.Core.Page.Col...
http://documentation.concrete5.org/api/class-Concrete.Core.Page.Pag...
You can try this: