1

I have a component that adds a menu option ("Connect Daily Calendar") to the Joomla Components menu.

What I would like to do is under certain circumstances "decorate" the menu option's text. For example, if some condition is met, put an exclamation point or similar icon on the menu option indicating that there's a condition that needs taken care of.

For example, if they haven't yet created a calendar event, have an exclamation point on the menu option indicating there's a message pending.I understand how to enqueue the message after they land on my component's page.

I do have a running system plugin, and I know how to hook into onAfterRoute() to show messages. For example, I'm planning on enqueueing a message on the content editor page that tells the user how to access the extension's plugin insertion dialog. I just want to be very specific about adding messages. If something isn't a critical issue, then I want to display the hint on my menu pad.

I've poked around JMenu and JMenuItem, but I just don't quite see what to do. I "think" if I could could get a reference to the JMenuItem for my component, then I could check the condition and adjust the img property. I'm just stuck at the right path.

Any help would be appreciated.

1 Answer 1

1

Instead of looking into JMenu class you should look into mod_menu and overriding its layout or a proper Java Script code cause this is a presentation (template) feature, not data. Just later menu item look in the proper layout file depending on conditions. Same goes for Java Script. Depending on conditions include the script that will later a proper menu item. All of menu items have a unique ID. So both ways will be easy to make.

1
  • I'm afraid I'm lacking a bunch of basic knowledge to be able to use your answer. Could you please elaborate on your answer? Keep in mind that I'm trying to modify the joomla administrator menu option for an installed component. Commented May 23, 2017 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.