Hello,

I've really searched the forum, the doc, and either I can't get solutions to work, either it was not exactly what I was looking for.

I've created a view with the "view" module to display news on the website. The path to this view is : Home > news
But when I click to read the entire news, the node is not related to its parent. I want to to activate the "news" link when I'm on a page tagged "news".

I've already managed to find if a node is tagged "news" but $secondary_links is empty and I can't find how to force to make as if it were on the page "news".

Thx for any help.

Comments

robertgarrigos’s picture

I was looking for an answer to this same question, so this is what I'm doing, although I don't know whether there is a better way of achiving this.

I'm adding a new _phptemplate_variables($hook, $vars) function in my template.php file. This is it:

function _phptemplate_variables($hook, $vars) {

  if ($hook == 'node') {
    if ($vars['node']->type == 'story') { // change this to the node type you use for you use news
      menu_set_active_item('news'); // change this to the path of your news page
    }   
  }
  return array();
}

I hope this is self explanatory enough.

---
Robert Garrigos
Professional site: robert.garrigos.cat
Catalan Drupal Users Group: drupal.cat

robertgarrigos’s picture

Put this in the template file for your node type for news. Let's say this is node-story.tpl.php. Add this at the beginning of that file:

<?php
menu_set_active_item('news');  // change this to the path of your news page
?> 

---
Robert Garrigos
Professional site: robert.garrigos.cat
Catalan Drupal Users Group: drupal.cat

robertgarrigos’s picture

mmmm I'm loosing the tabs when using this......

Any solution?

---
Robert Garrigos
Professional site: robert.garrigos.cat
Catalan Drupal Users Group: drupal.cat

scip’s picture

dtabach’s picture

subscribing...

Durval Tabach