phptemplate

Loading a css && js to front-page

  1. function phptemplate_preprocess_page(&$vars, $hook) {
  2.   // our front-page-tabs css && js
  3.   if($vars['is_front'] == 1){
  4.       //dpm(path_to_theme().'/scripts/front-page-tabs.js');

Overriding template suggestions

  1. function phptemplate_preprocess_page(&$vars) {
  2.   // Content switching
  3.   $vars['template_files'][] = 'page-'.$node->type;
  4. }

PHPTemplate Callback

  1. <?php
  2.  
  3. function modelxonline_node_form($form) {
  4.   if(file_exists(path_to_theme().'/'.$form['type']['#value'].'_form.tpl.php')) {

Get $vars keys

  1. <?php
  2. $vars = get_defined_vars();
  3.  
  4. foreach ($vars as $key => $var) {
  5.         print $key;
  6. }
  7. ?>
Syndicate content