• Resolved MandrinSA

    (@mandrinsa)


    Hi there,

    Next to the “click to expand the menu” hamburger icon, I have made descriptive text called “MENU” with the following code:

    /* START OF Add "MENU" text to 3-BAR Menu button  */
    .btn-toggle-nav {
        width: 90px;
        height: 30px;
        vertical-align: top;
    }
    
    .btn-toggle-nav:after {
        content: "Menu";
        float: right;
        color :#ffffff !important;
        text-shadow: 1px 1px 1px rgba(0,0,0,.25);
    }
    /* END OF Add "MENU" text to 3-BAR Menu button  */
    

    This displays fine.

    But what I also want to do is make the name “MENU” also clickable to expand the menu. Just like clicking the hamburger icon.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi,

    Please go to Appearance -> Customize -> Header -> Navigation Menus
    Find the setting -> Display a label next to the menu button.
    Check the checkbox
    Save changes.

    Thank you

    Thread Starter MandrinSA

    (@mandrinsa)

    Hi there,

    Sorry, but I don’t see any setting like that.

    Are you referring to setting the menu to right vertical?

    Thank you.

    Hi,

    For the main menu, you have to be using Side menu ( vertical ), in order for that setting to appear.

    You can use Side menu ( verticql ) qnd secondary horizontal menu for your website.

    Thank you

    Thread Starter MandrinSA

    (@mandrinsa)

    Hi there,

    Yea, I thought as much. Bummer ??

    I really only want to use the horizontal menu. Vertical menu’s still cause issues on certain mobile browsers.

    Oh well, I will just edit the hamburger bars to text, so I can use that Div’s popout properties.

    Thank you anyways ??

    Thread Starter MandrinSA

    (@mandrinsa)

    I am going to have to add some JS

    Will see if I can get it to work…

    • This reply was modified 8 years, 2 months ago by MandrinSA.
    Thread Starter MandrinSA

    (@mandrinsa)

    Found it here in czr-front.php

     /**
        * Menu button View
        *
        * @return html string
        * @package Customizr
        * @since v3.3+
        *
        */
        function czr_fn_menu_button_view( $args ) {
          //extracts : 'type', 'button_class', 'button_attr'
          extract( $args );
    
          $_button_label = sprintf( '<span class="menu-label">%s</span>',
            '__sidenav' == current_filter() ? __('Close', 'customizr') : __('Menu' , 'customizr')
          );
          $_button = sprintf( '<div class="%1$s"><button type="button" class="btn menu-btn" %2$s title="%5$s">%3$s%3$s%3$s </button>%4$s</div>',
            implode(' ', apply_filters( "tc_{$type}_button_class", $button_class ) ),
            apply_filters( "tc_{$type}_menu_button_attr", $button_attr),
            '<span class="icon-bar"></span>',
            (bool)esc_attr( CZR_utils::$inst->czr_fn_opt('tc_display_menu_label') ) ? $_button_label : '',
            '__sidenav' == current_filter() ? __('Close', 'customizr') : __('Open the menu' , 'customizr')
          );
          return apply_filters( "tc_{$type}_menu_button_view", $_button );
        }
    

    Now I just need to figure out how to make the changes I need ??

    Thread Starter MandrinSA

    (@mandrinsa)

    Ok, sorted.

    On line 878 (or find “open”) of my /themes/customizr/inc/czr-front.php

    I edited the line to:
    $_button = sprintf( '<div class="%1$s"><button type="button" class="btn menu-btn" %2$s title="%5$s">%3$s%3$s%3$s </button><button type="button" class="btn menu-btn" %2$s title="%5$s">Menu </button>%4$s</div>',

    That whole defining section now looks like this:

      /**
        * Menu button View
        *
        * @return html string
        * @package Customizr
        * @since v3.3+
        *
        */
        function czr_fn_menu_button_view( $args ) {
          //extracts : 'type', 'button_class', 'button_attr'
          extract( $args );
    
          $_button_label = sprintf( '<span class="menu-label">%s</span>',
            '__sidenav' == current_filter() ? __('Close', 'customizr') : __('Menu' , 'customizr')
          );
          $_button = sprintf( '<div class="%1$s"><button type="button" class="btn menu-btn" %2$s title="%5$s">%3$s%3$s%3$s </button><button type="button" class="btn menu-btn" %2$s title="%5$s">Menu </button>%4$s</div>',
            implode(' ', apply_filters( "tc_{$type}_button_class", $button_class ) ),
            apply_filters( "tc_{$type}_menu_button_attr", $button_attr),
            '<span class="icon-bar"></span>',
            (bool)esc_attr( CZR_utils::$inst->czr_fn_opt('tc_display_menu_label') ) ? $_button_label : '',
            '__sidenav' == current_filter() ? __('Close', 'customizr') : __('Open the menu' , 'customizr')
            );
          return apply_filters( "tc_{$type}_menu_button_view", $_button );
        }

    If you see another text block called “Menu” that is NOT clickable to reveal the menu items, then just edit your .css to hide it like so:

    @media (max-width: 980px) {
    .btn-toggle-nav .menu-label {
           display: none;
      }
    }

    I am glad I got this sorted, because some of my clients are older and if they are browsing my site on their mobile phones, they wont know to click the hamburger icon to expand the navigation menu.

    Regards,

    Glad you got it!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Making the word “MENU” clickable’ is closed to new replies.