Get Menu ID
Moderators: pe7er, General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
- dagger2002
- Joomla! Enthusiast
- Posts: 162
- Joined: Wed Mar 26, 2008 4:22 pm
- Location: So. Cal
Get Menu ID
Hey Guys I have fixed one issue to find another.
When i click on my Latest News Module I lose my item ID. Which means when I have a module assigned to the home page menu item only, it disappears. So I am looking for a way to grab the menu Id So that I can reset it up, or make sure that is correct.
Thanks
PS
I am using 1.7.
When i click on my Latest News Module I lose my item ID. Which means when I have a module assigned to the home page menu item only, it disappears. So I am looking for a way to grab the menu Id So that I can reset it up, or make sure that is correct.
Thanks
PS
I am using 1.7.
- dagger2002
- Joomla! Enthusiast
- Posts: 162
- Joined: Wed Mar 26, 2008 4:22 pm
- Location: So. Cal
Re: Get Menu ID
Any one have any idea how to get the menu item that is being used. I have spent many hours combing the api / documentation, and have come up with bupkiss. Cant find a solution to this issue.
I have figured out it is how the article is being linked between the news module, and a menu item. They are different.
Thanks
I have figured out it is how the article is being linked between the news module, and a menu item. They are different.
Thanks
-
- Joomla! Apprentice
- Posts: 18
- Joined: Sun Aug 07, 2011 6:24 am
- Contact:
Re: Get Menu ID
Here some menu things...
Code: Select all
// get application
$app = JFactory::getApplication();
// get menu
$menu = $app->getMenu();
// get active menu id
$activeId = $menu->getActive()->id;
// get active menu
$active = $menu->getActive();
// get active menu id
$activeId = $active->id;
// get active parent id
$currentMenuParent = $active->parent_id;
// get active menu item title
$menutitle = $active->title;
// get menu item by id
$otherMenuItem = $menu->getItem( $menuID );
// get other menu item title
$title = $otherMenuItem->title;
"Computer says no" - C. Beer
- dagger2002
- Joomla! Enthusiast
- Posts: 162
- Joined: Wed Mar 26, 2008 4:22 pm
- Location: So. Cal
Re: Get Menu ID
Ok its giving me nothing.
This is telling me that joomla isnt passing a menu item to the page.
Any Ideas?
This is telling me that joomla isnt passing a menu item to the page.
Any Ideas?
- dagger2002
- Joomla! Enthusiast
- Posts: 162
- Joined: Wed Mar 26, 2008 4:22 pm
- Location: So. Cal
Re: Get Menu ID
Does any one have a suggestion on how I can get my menu id to be recognized?
I am using core components and its not working.
I am using core components and its not working.
-
- Joomla! Apprentice
- Posts: 18
- Joined: Sun Aug 07, 2011 6:24 am
- Contact:
Re: Get Menu ID
Maybe you have some corrupted files there. Try to upload new core files.
"Computer says no" - C. Beer
- dagger2002
- Joomla! Enthusiast
- Posts: 162
- Joined: Wed Mar 26, 2008 4:22 pm
- Location: So. Cal
Re: Get Menu ID
This is getting weird.
Now I am getting the following message whenever I go to the site.
The URL is not valid and cannot be loaded.
Any thoughts?
Now I am getting the following message whenever I go to the site.
The URL is not valid and cannot be loaded.
Any thoughts?
-
- Joomla! Enthusiast
- Posts: 105
- Joined: Thu Aug 27, 2009 3:07 am
- Location: Troy, MI - USA
Re: Get Menu ID
Where is it that you writing code?dagger2002 wrote:Does any one have a suggestion on how I can get my menu id to be recognized?
I am using core components and its not working.
Taking a stab here, when you click on the an item in the Lastest News module, that item is your "active" item, so you won't be able to get an Menu Id/Item Id, unless you have already created a menu link to that item in the backend. Since it doesn't have an item id, have you tried to set an item id? and see if it works.
Are you going to alter the latest news module to add Item ids' in theres?
I doubt your files are corrupt.
- dagger2002
- Joomla! Enthusiast
- Posts: 162
- Joined: Wed Mar 26, 2008 4:22 pm
- Location: So. Cal
[SOLVED] Get Menu ID
I found a solution. The files had gone corrupt.
Reinstalled, luckyily it is still a dev site with very little stuff in it, Everything is working great.
Reinstalled, luckyily it is still a dev site with very little stuff in it, Everything is working great.