Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6593533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:41:39+00:00 2026-05-25T17:41:39+00:00

Another day playing around with joomla, and another shortcoming to fix :) This time

  • 0

Another day playing around with joomla, and another shortcoming to fix 🙂

This time it comes in the form of the administration(backend) menu.
To add items/subitems to this menu, people have to write the menu items in an xml file accompanying their components/extension/plugin/whatever.
When the extension is installed, joomla “generates” the menu items and “stores” them in the DB.
Effectively, the real/tangible menu is rendered by reading the DB.

This has several implications:

  • The menu is not scriptable
  • The menu is not dynamic; changing the XML file after installation, won’t update the menu
  • Removal of items is not scriptable; joomla takes care of removing any items when you uninstall the extension.

I’ve got this system which relies on the ability to modify menu items on the fly, but through code.
Simply put, I need to have functionality where I can create a volatile menu item (ie, it gets removed at the end of session).

To do so, I’ve got a couple of prospective hacks:

  1. Override the joomla global database instance so that I can make it return fake menu items. This is possible since the database object is stored in a public property of JFactory class: JFactory::$database=new MyFakeJDatabase(JFactory::$database);
  2. Intercept the menu code (html) before being output and mess it up according to my needs. This is not template-friendly in that the end result would be injecting html, which might not be what the template was designed for.
  3. Create menu items through javascript. This suffers issues with the template AND the javascript that toggles submenus.
  4. Create menu items in the DB whenever I need them and somehow “tag” my items so that I remove them the next time (or end of session). This sounds like it would work like a charm. Since I can buffer menu items, I could possibly create my menu items in one whole SQL statement. Than I could use another SQL to remove the tagged menu items. 2 SQL statements might not be much of a load on the server.

What do you think?

Edit: I’ve checked joomla/administrator/modules/mod_menu/helper.php to see if I could find a way to inject my stuff, wishing that maybe joomla used a global variable or something, but to no use – the menu items are creating directly by reading the db and rendering as well.
FYI I’ve searched a while on Google, to no use.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:41:39+00:00Added an answer on May 25, 2026 at 5:41 pm

    The “correct” way would be to write a module which overrides the core menu module to achieve the old functionality with the added feature of dynamic menus from whatever source you have. Not particularly a nice way to go, but that is Joomla’s way.
    Thanks to @ircmaxell to point this method out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good Day! i want to add a subview in another view in iphone. and
another sql problem of mine .. this time the reader doesn't work properly (
This is my first day playing with CI and I really like it so
another day, another problem. Honestly, it would be rather boring if this ever stopped,
I'm playing around with the jQuery Week Calendar and am trying to get this
Another question related to this one . I have a List<SortableObjects> that is the
Another jquery calculation question. I've this, which is sample code from the plugin site
another day with Rails and today I want to use Ajax. linkt_remote_link for changing
Another Day, another CoreData problem,...but hopefully the last one now. Ok here is a
I am reading from a file with data like this: {day :Monday, alarm:on, kids:School

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.