Page 1 of 1

Element ID in each menu item and subenu item in responsive sidebar menu

Posted: Wed Mar 15, 2023 12:24 am
by liurudys
Dear Pablo and Crispy68,

Please help, what if I want to do or provide an "Id" element for each menu item or submenu item when I design with WWB for the Responsive Sidebar menu extension?

Image

Re: Element ID in each menu item and subenu item in responsive sidebar menu

Posted: Wed Mar 15, 2023 3:01 am
by crispy68
Why are you wanting to add an ID to each menu link? What are you trying to do exactly? I think you will need to use javascript to add an ID to each link.

Re: Element ID in each menu item and subenu item in responsive sidebar menu

Posted: Wed Mar 15, 2023 4:03 am
by liurudys
Dear Crispy68,

Because I want to use it to create dynamic menus using the TMS Web Core Framework and design WWB as the html template so that it relates to element ID so that it can be used to display visible or not visible based on the user menu that is given access rights, how about in WWB how do I put each ID element in each link via javascript?

Re: Element ID in each menu item and subenu item in responsive sidebar menu

Posted: Wed Mar 15, 2023 7:26 am
by Pablo
There is no option to add an ID to individual menu items.
This will require a custom script.

Re: Element ID in each menu item and subenu item in responsive sidebar menu

Posted: Wed Mar 15, 2023 3:03 pm
by liurudys
Dear Pablo,

Ok, Thanks for the suggestion and now I have a solution with javascript :

var dropdownToggle = document. querySelector('.dropdown-toggle');
if (dropdownToggle && dropdownToggle.textContent.trim() === 'Setting') {
dropdownToggle.id = 'dropdown-toggle';
}