template.php

Fix for Theme links - print descriptions of primary menu items

  1. <?php
  2.  
  3. /**
  4. * Return a themed set of links.
  5. * An override of theme_links()
  6. * Modified to use simple text styling instead of HTML & CSS
  7. *
  8. * @see theme_links
  9. */
  10. function phptemplate_links($links

Fix for Add JavaScript to only one node

  1.  

Fix for in_array problem

  1. function security_list_term_voc($vid) {
  2.         $items = array();
  3.         $terms = taxonomy_get_tree($vid);
  4.         foreach ( $terms as $term ) {  
  5.             $items[] = $term->name;
  6.         }
  7.          return $items;
  8. }

in_array problem

  1. function security_list_term_voc($vid) {
  2.         $items = array();
  3.         $terms = taxonomy_get_tree($vid);
  4.         foreach ( $terms as $term ) {  

phptemplate css code

  1. function _phptemplate_variables($hook, $vars = array()) {
  2.   switch ($hook) {
  3.     case 'page':
  4.       $css = drupal_add_css('sites/all/themes/madebynikki/cmspros.css', 'theme');

Theme links - print descriptions of primary menu items

  1. <?php
  2.  
  3. /**
  4. * Return a themed set of links.
  5. * An override of theme_links()
  6. * Modified to use simple text styling instead of HTML & CSS
  7. *
  8. * @see theme_links
  9. */

template.php from review site

  1. function review_preprocess_node(&$vars, $hook) {
  2. //print_r($vars); exit;
  3.   if ($vars['type'] == 'article') {
  4.     $vars['title'] = str_replace('&amp;#1', '&#1', $vars['title']);
  5.   }
  6. }

User roles as body classes

  1. **
  2.  * Override or insert variables into the page templates.
  3.  *
  4.  * @param $vars
  5.  *   An array of variables to pass to the theme template.
  6.  *
  7. */
  8. function phptemplate_preprocess_page(&$vars) {

Example of your custom template variable

  1. function MIPLANTILLA_preprocess_node(&$vars, $hook) {
  2.  $node = $vars->$node;
  3.  if ($node->type == 'MITIPODECONTENIDO'){
  4.    $vars['texto'] =  $node->field_texto[0]['view'];
  5.    }
  6. }

Body classes for css

  1. switch ($hook) {
  2.     case 'page':
  3.      
  4.       // Check for logged in or anonymous user
  5.       $vars['logged_in'] = ($user->uid > 0) ? TRUE : FALSE;
  6.      
Syndicate content