How to add/remove menu item programmatically?

For Joomla! 2.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Note: All 1.6, 1.7 and 3.5 releases have reached end of life and should be updated to 3.x.

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
skinniPT
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Mar 22, 2016 2:20 pm

How to add/remove menu item programmatically?

Postby skinniPT » Tue Mar 22, 2016 2:23 pm

I have a Joomla v2.5.14 application and I'm in a situation that I need to hide a menu item from the users based on a database value, basically what I need is to hide the menu item based on a condition.

My question is, where's the right place to perform this? and how to do it?
Last edited by toivo on Tue Mar 22, 2016 3:29 pm, edited 1 time in total.
Reason: mod note: moved to 2.5 Coding

User avatar
sudo-web
Joomla! Ace
Joomla! Ace
Posts: 1325
Joined: Fri Jan 22, 2016 7:10 pm
Location: Vienna - Austria
Contact:

Re: How to add/remove menu item programmatically?

Postby sudo-web » Tue Mar 22, 2016 3:59 pm

Hello and welcome to the Joomla! Forum.

As one of our moderators already suggest it and moved this to the Coding Section of the Forum, the only way I know to do it is to Code a own plugin that handle this for you.

Before we go deeper into it. Do you have any Coding experience?

If no I would recommend that you ask someone form the Joomla! Resource page:
http://resources.joomla.org/en/provider ... rogramming

Doses are all people who know how to code within Joomla but it's not free of charge.
You can find me there as well.

BTW: Joomla 2.5.14 is not the latest release in of Joomla 2.5.x you should upgrade to at least 2.5.28 or better to Joomla 3
Visit me on my Webdesign Webpage: https://www.posit.at

skinniPT
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Mar 22, 2016 2:20 pm

Re: How to add/remove menu item programmatically?

Postby skinniPT » Wed Mar 23, 2016 3:02 pm

Resolved it with some help from stackoverflow:

http://joomla.stackexchange.com/questio ... mmatically

Thanks everyone!

User avatar
sudo-web
Joomla! Ace
Joomla! Ace
Posts: 1325
Joined: Fri Jan 22, 2016 7:10 pm
Location: Vienna - Austria
Contact:

Re: How to add/remove menu item programmatically?

Postby sudo-web » Wed Mar 23, 2016 3:47 pm

This will only add some CSS and the menu will be visible for anyone how is not using a normal Browser: like Google, persons how use a Screen reader and so on.
Visit me on my Webdesign Webpage: https://www.posit.at

Hspsms
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed May 25, 2016 9:34 am

Re: How to add/remove menu item programmatically?

Postby Hspsms » Fri Jun 03, 2016 9:24 am

Hello sir

i also have the same issue in my account. and then i have to delete it.


Return to “Joomla! 2.5 Coding”

Who is online

Users browsing this forum: No registered users and 3 guests