Jump to content

Neeraz

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Neeraz

  1. 8 hours ago, kongondo said:

    Welcome to the forums @Neeraz,

    It was decided early on to add classes to the <li> instead of the <a>, as it was the usual practice.

    Getting the <a> via CSS is quit easy, for instance...

    
    #menu li a {
    /* your styles here*/
    }

    You can be as specific as  you want with your CSS.

    Not a good idea as this will get overwritten next time you upgrade Menu Builder :-).

    i know this but i have no permission to modify customer css file so had to do this, i suggest you to add the same option in future update so it will be more flexible ?

    • Like 1
  2. i added new option in menu options because i needed css class in <a> tag, searched for a while and didn't find any example so had to do the following.

    $NavOptions = array(
                                    'wrapper_list_type' => 'ul', // ul, ol, nav, div, etc.
                                    'list_type' => 'li', // li, a, span, etc.
                                    'menu_css_id' => 'navbarSupportedContent', // a CSS ID for the menu
                                    'menu_css_class' => 'navbar-nav ml-auto', // a CSS Class for the menu
                                    'current_class' => 'active',
                                    'default_title' => 0, // 0=show saved titles;1=show actual/current titles
                                    'default_class' => 'nav-item', // a CSS class to apply to all menu items
                                    'ahref_class'=>'nav-link'
                                );

     

    added following line in MarkupMenuBuilder.module
    $this->set('linkClass', isset($options['ahref_class']) ? $options['ahref_class'] : '');

    // if $iTag is empty, apply css id and classes to <a> instead
    if(!$iTag) $out .= "\n\t<a{$itemCSSID}{$class}{$newtab} href='{$m->url}'>{$m->title}</a>";
    else $out .= "\n\t<{$iTag}{$itemCSSID}{$class}>\n\t\t<a{$newtab} href='{$m->url}' class='{$o->linkClass}'>{$m->title}</a>";

    suggest me if there is any better way out!!

    • Like 2
×
×
  • Create New...