Fill RSForm Fields With Fields Value From FlexiContent

More
12 years 3 months ago #22236 by startpoint
I think this is a question that ask users of the component.
Can you offer an example of how to do that:
1) by completing the plugins in component RSForm;
2) or Use PHP and javascript inside FLEXIcontent item to populate RSforms fields with data as proposed here www.flexicontent.org/forum/index ... pic#p21837 .
Options for placing this form are in item view or show form for each item in the category view.
In my case, I must fill out a form that is displayed in items category view.
It might be easier for many developers in the forum. I hope to share their experiences and solutions.
Any proposals would benefit everyone.

Thanks in advance.
Successes

Notebooks, computers and software in Varna - startpointbg.com

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

More
12 years 3 months ago #22265 by ggppdk
I have add this FAQ item

www.flexicontent.org/documentati ... forms.html

Besides item title, if you want to retrieve item data for a specific field you could LEFT JOIN the table #__flexicontent_fields_item_relations
Code:
$db = & JFactory::getDBO(); $fcitem_id= JRequest::getInt('id',0); $fccat_id= JRequest::getInt('cid',0); $view= JRequest::getVar('view'); if ($view!='items' && $view!='article') { return "not in items view"; } $field_id=45; // CHANGE THIS TO THE ID OF YOUR FIELD if ($fcitem_id) { $query = 'SELECT c.title, c.alias, f.value ' .'FROM #__content AS c ' ' LEFT JOIN #__flexicontent_fields_item_relations AS f ON f.item_id = i.id AND f.field_id='.(int)$field_id; .'WHERE c.id = ' . $fcitem_id; $db->setQuery($query); $itemdata = $db->loadObject(); $item_title = $itemdata->title; } return $itemdata->value;

NOTE you may have to unserialize: $itemdata->value
e.g.
$itemdata->value = unserialize($itemdata->value);
return $itemdata->value[data1];


-- 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 3 months ago #22343 by startpoint
Thanks for the help!
But how to realize this in category view? This work only in item view. If I show this code in category view, there is visible only category name. I know that there no item id, but i don't know how to get it from hidden field for each item.
As an example I have 1 category with 6 items. When I show all items from this category I want to show some fields and custom input form with some filled fields from each item.
This is the logic in the online store. In the list of products each of them can be added to the cart, in a form to send title, completed quantity and price, without opening the product separately.
Example, as implemented here gtsmarket.com/category/212/car-monitors.html?page=5 .
This may be realize when click to show hidden form and filled required fields or show in modal window.
Unfortunately, and I could not find any component of the online shop and I could adjust it so that its products be FLEXIconntent items. (If anyone has such a proposal can also share it.)

Best Regatds

Notebooks, computers and software in Varna - startpointbg.com

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

More
12 years 3 months ago #22364 by ggppdk
You can try the following to retrieve the items of the currently viewed category:
Code:
<?php JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_flexicontent'.DS.'tables'); require_once("components/com_flexicontent/classes/flexicontent.fields.php"); require_once("components/com_flexicontent/classes/flexicontent.helper.php"); require_once("components/com_flexicontent/models/category.php"); $catmodel = new FlexicontentModelCategory(); $category = $catmodel->getCategory(); $items = $catmodel->getData(); $cid = JRequest::getVar('cid',0); $params = $catmodel->_loadCategoryParams($cid); $items = FlexicontentFields::getFields($items, 'category', $params); ?>


-- 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 2 months ago #22415 by startpoint
Sorry for stupid question, but where to put the code to be able to extract information from the fields: in FLEXIcontent or in RSform?
I'm not a programmer, and it's hard to figure out how to do it.
Thanks in advance.

Best Regards

Notebooks, computers and software in Varna - startpointbg.com

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

More
12 years 2 months ago #22416 by ggppdk
mmm, this code is meant to be used be developers.

You asked how to do it in category view. With this code you will get an array of items of current category. You should use it in the RSform, and call it in order to create text for an RSform field.

But you will need to manipulate the array of items to create a string of something that includes data of all items.


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