How ro render specified item?

More
12 years 1 month ago #29999 by dkom
Hello! In my PHP code I want to render specified $id (id of flexicontent item) with $template (flexicontent template).

How me to do it?

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

More
12 years 1 month ago #30004 by ggppdk
What PHP code?

is your code executed with Joomla framework loaded or it some custom code?

which component is active? is it flexicontent or other?

if it is flexicontent which view is active? (category?)


-- 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.

More
12 years 1 month ago #30006 by dkom
Replied by dkom on topic How ro render specified item?
Yes, it is my own Joomla module. I have two variables $flexiItemId and $template and want to visualize this item with `item` layout.

Currently my code runs while rendering option=com_flexicontent&view=item, but... why does it matter? I want (if it possible) universal code just to render the item I have (or maybe array of items).

For example I want something like:
Code:
for ($itemsId as $itemId) { $item = new FlexiItem($itemId); $template = new FlexiTemplate($templateName); $html = $template->render($item); echo $html; }

Right now to render my item as workaround I download URL:
Code:
JURI::base()."index.php?option=com_flexicontent&view=item&tmpl=component&id=".intval($itemId);
But it is
1) gets HTML only for default item type template
2) overkill due to unnesessary HTTP requests

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

More
12 years 1 month ago #30013 by ggppdk
there is code for rendering an item in category view *(an FC content item mean to display author description)

but i think maybe it would be better to use iframe?


-- 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.

More
12 years 1 month ago #30022 by dkom
Replied by dkom on topic How ro render specified item?
I'll see code in categories view...

IFrame is not good solution because of problems with CSS in that case. Also HTTP overkill still exists.
(have imagined page with 100 iframes... 100 net requests). :?

I browsed the code of flexicontent and see that is uses JRequest parameters. Maybe better to make new abstraction level, to do model to be not depending of network parameters?

Another idea (as workaround) is to save JRequest parameters, fill with another, run Flexi renderer, and load old JRequest parameters. How do you think, as Flexi developer, is it realistic?

Also, I think, feature to easely use CCK items in code is key for CCK. I was very surprised (after using Drupal CCK) that Flexicontent does not have this one.

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

More
12 years 1 month ago #30030 by dkom
Replied by dkom on topic How ro render specified item?
The code from categories is terrible, it is context dependent, uses JRequest static variables instead of function arguments.
If it'll be fixed, the work with CCK becames much easy and flexible.


Btw, I have done better workaround:
Code:
shell_exec('php '.$_SERVER['SCRIPT_FILENAME'].' option=com_flexicontent view=item tmpl=component id=' . intval($itemId))

and parsing <body> tag. But it is still not the best solution for that.

If I can improve and contribute code into Flexicontent, let me know, how do you think: is it possible without changing all product design to create new abstraction level (between JRequest and FlexiContent item/categories classes) and from where to start.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.355 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