The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat May 05, 2012 2:27 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat May 05, 2012 2:12 pm
Posts: 5
Hi

I'm trying to do something that i would have thought to be simple, but after several hours with plenty of cups of tea and still no answer... i need help please!!! :o)


All i'm trying to do is fetch the Menu ID of each Article listed on a Blog Category page. It seems i can get the Article ID and the main category ID no problem.

Here is what i have been trying in the html/com_content/category/default_items.php:

Code:
/* Item / Article ID  - WORKS FOR ARTICLE*/
$ItemID = $item->id;
echo $ItemID;

/* Get Current Active Category ID - WORKS FOR CATEGORY */
$currentMenuId = JSite::getMenu()->getActive()->id;
echo $currentMenuId;

/* Testing... Get Menu From Current Item ID - ERROR, ZIP, NOTHING!!! */
$fetchMenuId = JSite::getMenu()->$ItemID;
echo $fetchMenuId;


The default.php page is what seems to call up the "items" or "article list", not sure if the data is even in there??? I'm quite familiar with PHP but very new to Joomla, if someone could point me in the right direction i would appreciate it!


Thanks


Top
 Profile  
 
PostPosted: Mon May 07, 2012 11:41 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat May 05, 2012 2:12 pm
Posts: 5
Continued...

From what i can see so far the data in the array is mainly for the Article, and nothing do with the Menu object like i had originally thought. After printing out the array there is no values that link the Article to the Menu.

Therefore. am i correct in thinking i may need to run an independent query on the database using the Article ID?

The problem i can foresee with this is that there seems to be no link in the database table between the Article ID and the Menu ID, other than it listed in the url field.

Hope that makes sense?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 



Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group