hook_theme()
hook_theme()
/**
* Implementation hook_theme()
*/
function mcv_collection_theme($existing, $type, $theme, $path){
return array(
‘mcv_collection’ => array(
‘arguments’ =>array(‘data’=>NULL),
‘path’ => ‘sites/all/themes/mcvlive/templates’, //folder path where tpl file exists
‘theme path’ => ‘sites/all/themes/mcvlive’,
‘template’ => ‘collection’ //file name: collection.tpl.php
)
);
}
#### calling theme in content function
function collection_content{
$data[‘collection’] = $collection; //data
$data[‘paging’] = theme(‘pager’, NULL, $limit, 0); // pagination
$output = theme(‘mcv_collection’,$data); //calling theme
return $output;
}
### in collection.tpl.php use data
print $data[‘collection’];
print $data[‘paging’];
——————————-

Post a Comment