About $variables, $hook,...
By: Arshad
22 Mar 2010If you look a drupal node, drupal displays the author of this node as the username of the user or anonymous if the author is not registered user. Now if we want to display the real name of the user (a field we will add in the profile module) instead of the username, drupal provides a theming function that let's you modify the output of the username before it is printed on a node. Let's see how we can do this.
By: Arshad
19 Mar 2010I'll go directly to the code
This one goes in your template.php (under sites/all/themes/yourtheme/).
function phptemplate_menu_item_link($link) { } $link['localized_options']['attributes']['class'] = 'menu-'. $link['mlid']; } else { $link['localized_options']['attributes']['class'] .= ' menu-'. $link['mlid']; } return l($link['title'], $link['href'], $link['localized_options']); }
Hello I'm Arshad. I'm a 21 years old Drupal Web Developer. This is a site i put up for some reasons i can't remember and this is where i write stuffs i need to remember.;)
In the Web world, i head the Drupal Mauritius User Group and the jQuery user Group Mauritius and i'm a campus representative for Mozilla Firefox.