You are here

template.php in Service links 6

Same filename and directory in other branches
  1. 5 template.php
  2. 6.2 template.php
  3. 7.2 template.php

Example template.php for service_links.module (put the name of your theme instead of 'themename') Use <?php print $service_links ?> to insert links in your node.tpl.php or you page.tpl.php file.

File

template.php
View source
<?php

/**
 * @file
 * Example template.php for service_links.module (put the name of your theme instead of 'themename')
 * Use <?php print $service_links ?> to insert links in your node.tpl.php or you page.tpl.php file.
 */
function themename_preprocess_page(&$vars) {
  if (module_exists('service_links')) {
    $vars['service_links'] = theme('links', service_links_render($vars['node'], TRUE));
  }
}
function themename_preprocess_node(&$vars) {
  if (module_exists('service_links')) {
    $vars['service_links'] = theme('links', service_links_render($vars['node'], TRUE));
  }
}

/**
 * If something don't work well try this
 */
function themename_preprocess(&$vars, $hook) {
  switch ($hook) {
    case 'node':
      $vars['service_links'] = theme('links', service_links_render($vars['node'], TRUE));
      break;
    case 'page':
      $vars['service_links'] = theme('links', service_links_render($vars['node'], TRUE));
      break;
  }
}

Functions

Namesort descending Description
themename_preprocess If something don't work well try this
themename_preprocess_node
themename_preprocess_page @file Example template.php for service_links.module (put the name of your theme instead of 'themename') Use <?php print $service_links ?> to insert links in your node.tpl.php or you page.tpl.php file.