Find page by name
Permalink 2 users found helpful
I'm looking for a way to find a page by its name using php. Building a block, not sure if it's possible or how to do it.
Even if I could get a site nav list, I could probably parse that to find the information that I need.
Even if I could get a site nav list, I could probably parse that to find the information that I need.
You can use this :
$page = Page::getByName('my page name');
$page = Page::getByName('my page name');
You can filter by name, path, or many other attributes. Some code samples here:
http://www.concrete5.org/community/forums/customizing_c5/collection...
http://www.concrete5.org/community/forums/customizing_c5/collection...
http://www.concrete5.org/documentation/developers/pages/searching-a...
about 20% of the way down
$pl->filterByName()