2

does anyone know how to add links or HTML onto the left sidebar of a drupal theme without using a block? I am using drupal 7.14. Any help would be appreciated.

1
  • 1
    I'm curious: why do you not want to use a block? Knowing your reasoning/problem may help someone answer your question more appropriately? Also, are these links something you are trying to do on a single page or is this something you may want to re-use? Sep 17 '12 at 20:34
0

Can be done using the _phptemplate_variables function in template.php in your theme directory.

function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {
    foreach (array('left','right') as $region) {
      $vars[$region] = drupal_get_content($region);
      return $vars; 
    }
  }
}

And just call this function below where you want to display the link.

$output = l('some link text','node/1234');
drupal_set_content('left', $output); 
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.