Get fields from choosen item ID

More
10 years 10 months ago #37617 by Natwork
Hi everyone !
First I would like to thanks Flexicontent team for their great work !

I have a list of items that i want to display. I know their ids, but i can't display fields from this items.

I'm not sure if i speak correctly, so here is an exemple :

I have this :
Code:
JRoute::_(FlexicontentHelperRoute::getItemRoute($items[$i]->slug));

And i wonder to know if there is something like this :
Code:
JRoute::_(FlexicontentHelperRoute::getItemRoute([itemid]->slug));

In facts, i'm using a SQL request that gives me item ids that i want to display in an Array.
So i made this :
Code:
<?php foreach ($results as $itemid) : echo JRoute::_(FlexicontentHelperRoute::getItemRoute($items[$i]->slug)); endforeach; ?>

Anyone can help me to replace this "$items[$i]" with the good code?

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #37623 by ggppdk
Hello,
your question is more like a general Joomla question:
How to get a variable out of a menu item

outside loop:
Code:
$menus = JFactory::getApplication()->getMenu('site', array());

inside loop:
Code:
$menu = $menus->getItem($_component_default_menuitem_id); $fc_item_id = @$menu->query['id'];

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.262 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline