By kritro on
I'm new to Drupal and am trying to make a sub theme of zen. I try to theme the primary links.
Everywhere I look it says I should override theme_links(), but when I check with the theme devel module it says I should use themename_menu_item_link() to override the primary links.
When I try with other themes the devel module says the theme_link() is used.
I tried to override the theme_link() in my theme and only the "read more" link under the content in node.tpl.php, written by
<?php print $links; ?>
is affected.
The primary links written by
<?php print theme('links', $primary_links); ?>
is unaffected
Am I totally lost or does anybody know what this means
Thanks
kritro
Comments
Copy and rename zen_menu_item_link($link) into your template.php
Have you tried copying (and renaming) the zen_menu_item_link($link) function (in zen/template-menus.php) into your SUBTHEMENAME/template.php file? Something like this...
Theming primary links
Thanks
That seems right.
When i print it out, my two primary links is showed
Is this the place to add theming to the links? If I for inst. want to add a ">>" beetween the links, is this the place to do it by updating the $link array?
Is this not swinging by theme_links() method at all?
I can see it calls the l() method and it seems this is where the href tag is added
I mostly try to understand the consecpt here.
Thanks kritro
There are actually two primary links menus on Zen themes
Anything you do in the above function will modify the primary links outputted via the Primary Links block. So doing a $link['title'] .= '>>' there will alter your links.
However, there is also another Primary Links menu (which you can activate from admin/build/themes/settings/THEMENAME), and I think that one uses the theme_links() function instead. I'm not sure why there are two. I guess the former is the product of the Zen theme and the latter is the native Drupal one.
I dont have zen/template-menus.php file
I am using zen 6.x-1.1 but I can't find template-menu.php
how can I customize the menu?
thanks,
Leo