[SOLVED] How can you display all the field elements unserialized

More
8 years 5 months ago - 8 years 5 months ago #58165 by iamrobert
Hi,

I am trying to output a complete list of all the values in a checkbox from the field- not for each individual item - but for all the values.

My field name is "World Regions"
"field_elements":"region_01::North America%% region_02::South America%% region_03::Europe%% region_04::Middle East%% region_05::Africa%%"

The code I want is:
Code:
<input type="checkbox" value=".region_01" id="region_01"><label for="region_01">North America</label> <input type="checkbox" value=".region_02" id="region_02"><label for="region_02">South America</label> etc... for all the World Regions

The word "region_01" is the field value, The word "North America" is the label.

I have tried doing this in a category but it fails. ( www.flexicontent.org/documentation/faq/6...to-work-in-v156.html )

Any Ideas?
Last edit: 8 years 5 months ago by ggppdk.

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

More
8 years 5 months ago #58167 by micker
you want the config of field not value ...

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
8 years 5 months ago #58172 by iamrobert
Hi Micker,

How do I call "config of field"?

I have spent a day on this - but can't find an answer.

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

More
8 years 5 months ago #58174 by micker
Need georgios

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
8 years 5 months ago - 8 years 5 months ago #58204 by ggppdk
Code:
$fieldname = 'the_NAME_of_the_field'; if ( !isset($item->fields[$fieldname]->parameters) ) { FlexicontentFields::loadFieldConfig($item->fields[$fieldname], $item); } $extra_props = array(); // use $extra_props = array('image'); // if radioimage or checkboximage field $elements = FlexicontentFields::indexedField_getElements( $item->fields[$fieldname], $item, $extra_props );


-- 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...
Last edit: 8 years 5 months ago by ggppdk.
The following user(s) said Thank You: iamrobert

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

More
8 years 5 months ago - 8 years 5 months ago #58233 by iamrobert
Thanks so much and its super.

Here's my code that I can put into category_items:
Code:
<?php for ($i=$leadnum; $i == 1; $i++) : $item = $items[$i]; ?> <?php $fieldname = 'the_NAME_of_the_field'; if ( !isset($item->fields[$fieldname]->parameters) ) { FlexicontentFields::loadFieldConfig($item->fields[$fieldname], $item); } $extra_props = array(); // use $extra_props = array('image'); // if radioimage or checkboximage field $elements = FlexicontentFields::indexedField_getElements( $item->fields[$fieldname], $item, $extra_props ); if (!empty($elements)) foreach ($elements as $el) { if ( @unserialize($el)!== false || $el=== 'b:0;' ) $el = unserialize($el); //var_dump($el); // CALL STD OBJECTS echo $el->value; echo $el->text; } ?> <?php endfor; ?>
Last edit: 8 years 5 months ago by iamrobert.

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

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