Hello everyone

Can anyone plz tell me where I can chance the default “html content” output under taxonomy menu, as I want to change the html tags.

For example, in the regional html output, the default template has been using a list of nested

  • element with tags, but I could like to use tags instead, as well as inserting some other plain text in the middle somewhere between the output
  • Comments

    omcateer’s picture

    *sorry html in my message got rendered*
    Hello everyone

    Can anyone plz tell me where I can chance the default “html content” output under taxonomy menu, as I want to change the html tags.

    For example, in the regional html output, the default template has been using a list of nested < li > element with < a > tags, but I could like to use < h? >tags instead, as well as inserting some other plain text in the middle somewhere between the output

    indytechcook’s picture

    Status: Active » Fixed

    There are several places where you can change that.

    The HTML is created by the menu system. Taxonomy Menu only created the menu_links in the database (by the use of the menu system functions).

    The best place would be in your theme layer. http://api.drupal.org/api/search/6/theme_menu is a good place to start.
    Here is a guide for overriding theme output: http://drupal.org/node/341628

    THere are several other guides on blogs and such, your best bet for a how to is to google "drupal override theme function"

    Cheers,
    Neil

    omcateer’s picture

    Thank you the guide was very helpful but it is applying my changes to all menus on my website. How do I change only the taxonomy menu?
    Here is the code I placed in my template.php file:

    function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
      $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
      if (!empty($extra_class)) {
        $class .= ' '. $extra_class;
      }
      if ($in_active_trail) {
        $class .= ' active-trail';
      }
      return '<li class="'. $class .'">'. $link . $menu ."</li>\n";
    }
    

    Status: Fixed » Closed (fixed)

    Automatically closed -- issue fixed for 2 weeks with no activity.