Jump to content

Top Horizontal Menu - Make Categories Hover Only, Not Clickable


sickshot

Recommended Posts

I have CMS categories in top horizontal menu with some pages inside. so when you hover top menu, sub menu appears,but the category title itself is still clickable! for me its total nonsense.

 

Please anyone tell me how to make this categories titles non clickable. its not the first time I'm facing this issue, i'm pretty sure its not only me and there are lot of people out there who thinks the same. 

Link to comment
Share on other sites

  • 2 months later...

If anyone is still searching how to do it, I just did it and it worked...

 

1. Go to themes/default-bootstrap/css/modules/blocktopmenu/css/superfish-modified.css

 

2. Add under .sf-menu > li > ul > li > a  this code:

    pointer-events: none;
    cursor: default;

3. Change hover color to the same with no-hover

 

Your final code should look like this:

.sf-menu > li > ul {
  padding: 26px 30px 31px;
  width: 100%; }
  .sf-menu > li > ul > li > a {
    pointer-events: none;
    cursor: default;
    text-transform: uppercase;
    font: 600 16px/20px "Open Sans", sans-serif;
    color: #333; }
    .sf-menu > li > ul > li > a:hover {
      color: #333; }
Link to comment
Share on other sites

  • 4 months later...

open blocktopmenu.php and search for

               case 'CMS_CAT':
                    $category = new CMSCategory((int)$id, (int)$id_lang);
                    if (count($category)) {
                        $this->_menu .= '<li><a href="'.Tools::HtmlEntitiesUTF8($category->getLink()).'" title="'.$category->name.'">'.$category->name.'</a>';
                        $this->getCMSMenuItems($category->id);
                        $this->_menu .= '</li>'.PHP_EOL;
                    }
                    break;

change it to

               case 'CMS_CAT':
                    $category = new CMSCategory((int)$id, (int)$id_lang);
                    if (count($category)) {
                        $this->_menu .= '<li><a title="'.$category->name.'">'.$category->name.'</a>';
                        $this->getCMSMenuItems($category->id);
                        $this->_menu .= '</li>'.PHP_EOL;
                    }
                    break;

then go to blocktopmenu configuration page and rebuild the menu (or clear shop cache)

Link to comment
Share on other sites

I did what you explained. I rebuilt the module. However i noticed then that i dont use this module (unactive) for my theme !

 

There's no php in blocktopmenu of my theme, there's only one in the core(?).

 

Do you have another suggestion ?

 

Tks for the time spent!

Marion

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...