Get Current Page Name3 users found helpful
I've been looking through the readily available information on themes and also looking at the code in the default themes but I don't see this anywhere. Anyone have a clue how to do it?
<?php $page = Page::getCurrentPage(); echo $page->getCollectionName(); ?>
The code that I got to work is:
This works fine when outside of the Area object ($a). I am trying to fetch the stored value of an area object before displaying it. ie. NOT $a->display($c)
This post helped me find that. Thanks :)
Not sure it didn't work, but if anybody has any problems with the first method post here and I'll assist.
Second issue of using a variable is that it might be overwritten (using something as ubiquitous as a letter `c` for a (pseudo) global variable is already giving me the creeps), but a method will never be overwritten in PHP.