Get fields from choosen item ID

More
5 years 1 month 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 :
JRoute::_(FlexicontentHelperRoute::getItemRoute($items[$i]->slug));

And i wonder to know if there is something like this :
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 :
<?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
5 years 1 month 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:
$menus = JFactory::getApplication()->getMenu('site', array());

inside loop:
$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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.