PrimeBlocks menu

Post Reply
Posts: 2
Joined: 17 Mar 2019, 12:22

30 Oct 2022, 13:55


I am using application shell from one of PrimeBlocks, got navigation working but I can't figure out how to mark active menu item and expand it after navigation if it is a child menu item.
All pages include same template with menu.

Can someone help, is there some examples on how to achieve this?

Posts: 5229
Joined: 29 Jun 2013, 12:38

31 Oct 2022, 11:08


We use the following js code to active a menuitem according to router in Premium Layout. Maybe, it can help to you;

Code: Select all

           var link ='a[href^="' + this.cfg.pathname + '"]');

            if (link.length) {
                var submenu ='ul');
                var parentMenu = menuitem.closest('ul');
                submenu.length > 0 && submenu.removeClass('hidden');

                if (parentMenu.length) {
                    while (!parentMenu.hasClass('root-menuitem')) { // a custom class for root 'ul' element

                        parentMenu = parentMenu.closest('ul');
                        if (!parentMenu.length) {

                        parentMenu = parentMenu.closest('li');
Best Regards,

Post Reply

Return to “PrimeBlocks for PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest