Jump to content

Product subcategories hidden in top menu, I do not want CMS subcategories hidden


slotrios
 Share

Recommended Posts

I have hidden product subcategories in the top menu of my 1.6 prestashop by adding to the global.css this:

 

#block_top_menu ul li li ul {display:none!important;}

 

I achieved what I wanted, hide the products subcategories, but now even CMS subcategories are hidden. How can I avoid that?

 

Thanks a lot!!

Share this post


Link to post
Share on other sites

You could use nth-child, like this for example:

 

If your Categories are the first 5 elements in the main menu, and after that you have the cms pages, you could use:

 

#block_top_menu ul li:nth-child(-n+5) li ul {

    display: none!important;

}
 
You could also make other combinations to select all main items, if they are mingled with the cms or so. Then just add a second path to the css code, like:
 
#block_top_menu ul li:nth-child(-n+3) li ul,
#block_top_menu ul li:nth-child(5) li ul {

    display: none!important;

}
to select the first three and the fifth main item only. Be creative :-)
 
 
More example on how to use nth-child for example here:
 
Hope this helps,
pascal.

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More