I need to add classes to the <a> tag to get my modal windows working and I am now seeing that TB Mega Menu removes all class from the <a> tag. Why and is there any way I can fix this?

Comments

doors’s picture

Issue summary: View changes
doors’s picture

I am using the Menu Attributes (https://www.drupal.org/project/menu_attributes) module to add the css classes to menu itesms.

I am looking at the tb-megamenu-item.tpl.php file located at tb_megamenu/templates/tb-megamenu-item.tpl.php which prints out the menu items:

<li <?php print $attributes;?> class="<?php print $classes;?>">
  <a href="<?php print in_array($item['link']['href'], array('<nolink>')) ? "#" : url($item['link']['href']);?>" class="<?php print implode(" ", $a_classes);?> <?php print in_array($item['link']['href'], array('<nolink>')) ? "" : "ctools-use-modal";?>">
    <?php if(!empty($item_config['xicon'])) : ?>
      <i class="<?php print $item_config['xicon'];?>"></i>
    <?php endif;?>    
    <?php print t($item['link']['link_title']);?>
    <?php if($submenu && $block_config['auto-arrow']) :?>
      <span class="caret"></span>
    <?php endif;?>
    <?php if(!empty($item_config['caption'])) : ?>
      <span class="mega-caption"><?php print t($item_config['caption']);?></span>
    <?php endif;?>
  </a>
  <?php print $submenu ? $submenu : "";?>
</li>

The $a_classes doesn't take into account the classes added by other modules.

ytsurk’s picture

Status: Active » Closed (duplicate)
ytsurk’s picture