Call Section Name

Permalink
This is from the page "Useful Functions within Views and Controllers":


@bool $this->section($url)


Checks a given URL to see if you're in that url's section? (e.g. if you're on page "/about/my/company," passing $this->section('/about'); will return true.


My question: is there a way to call the name of the page's section and assign it to a variable?

Cheers
Darrell

stokini
 
ScottC replied on at Permalink Reply
ScottC
I would think loading up navigationhelper and getting trail to collection which is an array of page objects and grabbing the handles of those would provide the same sort of functionality using a custom model instead.

I know you have purchased the block, check out the models/blog.php i believe there is a determineParentBlogPage which does exactly this that i wrote.

-Scott
stokini replied on at Permalink Best Answer Reply
stokini
Thanks, Scott. I'm going to look into that, just for educational purposes! But in the mean time I found this on snippler.com:

<?php 
$page = Page::getByID($c->getCollectionParentID()); 
print $page->getCollectionName(); 
?>


It was added by c5.org member c5mix.

D