Last active
August 29, 2015 14:15
-
-
Save eklect/3aa0160d6a9d001920fd to your computer and use it in GitHub Desktop.
How to find all certain type of pages titles in c5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAllPagesList($parent,$type) { | |
$page_list = new PageList(); | |
$page_list->filterByParentID($parent->getCollectionID()); | |
$page_list->sortByName(); | |
$page_list->filterByCollectionTypeHandle($type); | |
$template_pages = $page_list->get(); | |
$return_data = array(); | |
foreach ($template_pages as $template_page) { | |
$title = $template_page->getCollectionName(); | |
array_push($return_data,$title); | |
} | |
return $return_data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment