Page_list show pages by multiple ID's
Permalink
I am using page_list
Can I show child pages of 2 and more pages ID
Because as it is now doesn't work
$bt = BlockType::getByHandle('page_list');
Can I show child pages of 2 and more pages ID
$bt->controller->cParentID = '146','147','152';
Because as it is now doesn't work
Loader::model('page_list'); $pl = new PageList(); $pl->filterByParentID(array(146,147,152)); $pages = $pl->getPage();
Doesnt show me anything(((
Try this:
Loader::model('page_list'); $pl = new PageList(); $ids = array(ID1, ID2, ID3); $db = Loader::db(); if (is_array($ids)) { for ($i = 0; $i < count($ids); $i++) { if ($i > 0) { $and.= ' OR '; } $and .= "p1.cParentID = " . $db->quote($cParentID[$i]); $this->filter(false, "({$and})"); } } $pages = $pl->getPage();
$bt->filter(false, "(p1.cParentID IN (146,147,152))");
Also see:
http://www.concrete5.org/documentation/developers/pages/searching-a...