When adding a panelist via package controller
Permalink
Hi,
I'm adding a pagelist block to a page that is created with a package controller, I don't seem to be able to set it for "Beneath". Both cParentID and cThis need to be set for the "Beneath" option to be the selected option. cThis never gets set using the code below. If I set cThis to 1 in the DB, then it works as expected.
Am I going about this wrong, or is there another problem?
thanks
I'm adding a pagelist block to a page that is created with a package controller, I don't seem to be able to set it for "Beneath". Both cParentID and cThis need to be set for the "Beneath" option to be the selected option. cThis never gets set using the code below. If I set cThis to 1 in the DB, then it works as expected.
Am I going about this wrong, or is there another problem?
thanks
// Page List Blog Listing Template $plBlock = BlockType::getByHandle('page_list'); if(is_object($plBlock)){ $plData['cParentID'] = $page->getCollectionID(); $plData['cThis'] =1; $plData['orderBy'] = 'chrono_desc'; $addBlock = BlockType::getByHandle('page_list'); // Add to Main area $block = $newPage->addBlock($addBlock, 'Main', $plData); }