Skip to content

Instantly share code, notes, and snippets.

@andrewminton
Created May 26, 2012 07:29
Show Gist options
  • Save andrewminton/2792773 to your computer and use it in GitHub Desktop.
Save andrewminton/2792773 to your computer and use it in GitHub Desktop.
Get Child pages DS by David Hund
<?php
require_once(TOOLKIT . '/class.datasource.php');
Class datasourceget_child_contentpages extends Datasource{
public $dsParamROOTELEMENT = 'sub-content-pages';
public function about(){
return array(
'name' => 'Get Child Contentpages',
'author' => array(
'name' => 'David Hund',
'email' => '[email protected]'),
);
}
public function allowEditorToParse(){
return false;
}
public function getSource(){
return '1';
}
public function grab(&$param_pool){
$param_pool['child-content-pages'] = Symphony::Database()->fetchCol('handle', 'SELECT `handle` FROM `sym_pages` WHERE `parent` = '.$this->_env['param']['current-page-id'].';');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment