Is it possible to exclude third level sub-categories from mega menu?

Posted in: Newspaper
Post count: 18

Hi, I’ve selected megemenu for my main categories but is there any way of excluding some sub categories from displaying, or at least showing the hierarchy of second and third level categories?

For example, if I have categories of:
Film > Film Reviews > Action films

But I only want Film and Film Reviews to show in the megemenu, not Action films as well. Is this possible?

Post count: 6535

Hi

To exclude some specific categories from mega menu add this line of code 'exclude' => '31, 32' in td_block_mega_menu.php like here: http://screencast.com/t/gLk8sgvLA and replace the initial numbers with the category’s id which you want to exclude from menu.
To get the category id please follow this link: http://screencast.com/t/fKn2qrSQ

Let me know how it goes.
Thanks!

  • This reply was modified 10 years by Andrei L..
Post count: 18

Hi, I tried this but it seemed to break the theme so I must have done t wrong. I restored the back up of that php file so it went back to normal, but I’m not sure what else I did, as tried to follow your instructions exactly.

Post count: 6535

Hi

Please make sure that you add the comma here: http://screencast.com/t/HCBO5mpujE86 then test again.

Thanks!

Post count: 18

Thanks, it was that missing comma. That’s worked now!

On a related note, is there a way to prioritise the order the categories appear in the meganav?

As a feature suggestion for future releases, I would like more flexibility to control what goes in the meganav, as I tend to customise my menus quite a lot but this is difficult if you want to use the meganav as well when it relies on the standard category/sub-category structure.

Thanks

Post count: 22421

Hello,
Unfortunately you cannot apply a custom sorting order easily. You will have to change the functionality of the mega-menu for that. You can however change the ascending or descending order by editing td_block_mega_menu and adding this line: 'order' =>'DESC' or this one: 'order' =>'ASC' like so: http://screencast.com/t/45zdwgQ2Sx
I hope this helps

Post count: 18

Hi, thanks, I’ll try that.

One thing I’ve just realised is that I removed categories from the mega menu, but they are still showing in the mobile menu. Could you let me know how I would also remove them from the mobile menu so both menus match?

Thanks

Post count: 22421

Hello,

Please provide a link to your website and point out which categories you will want removed from the menu .It can be done use css to do it but i need to inspect the menu in order to create the css code.

Thank you!

Post count: 1

+1 for the logic being tightened up on this in the Theme panel.

There needs to be a Menu setting that allows users to toggle the display of just second level sub-categories (which should be the default) or all sub-categories 0 as it is today. This workaround is a little messy.

Post count: 22421

Hello,
Unfortunately there is no option in the theme for it and a workaround is the only choice at the moment. Maybe in a future update we will be able to implement such an option if more users request it.
Thank you!

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.