field position with value not name display.

More
12 years 1 month ago #29321 by despair
I build a field with checkboximage type, and set the field elements with
color1::color1::Image1.jpg%% color2::color2::Image2.jpg%% color3::color3::Image3.jpg%% color4::color4::Image4.jpg%% color5::color5::Image5.jpg%% .....

I want to use the image in the item view to show the color, but in the category view I want to show the field value(color1,2,3...) as any item's div class.

<li class="box <?php if (isset($items[$i]->positions)) : ?> <?php foreach ($items[$i]->positions as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?><?php endif; ?>">

How do I modify the echo for value not $field->display.
<?php echo $field->display; ?>

And If I want to show the field image and field value in a item with different position at category view, Is it possible?

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

More
12 years 1 month ago #29351 by ggppdk
You can add extra display variables to the imagecheckbox field: (better copy (see our FAQ article) & create a new custom field)
Code:
$view = JRequest::getVar('flexi_callview', JRequest::getVar('view', FLEXI_ITEMVIEW)); if ($view==FLEXI_ITEMVIEW) { $field->{$prop} = '...'; } else { $field->{$prop} = '...'; }

above prop is 'display'
Also above you could use custom variables e.g.

$field->display_ival = '...';


-- 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 #29374 by despair
Sorry ggddpk
I'm a designer so not good at this. :oops:
Did you mean that I need to duplicate a field plugin like this FAQ" flexicontent.org/documentation/faq/42-fa...icontent-fields.html " and modify the "checkboximage.php".

I'm not sure how to modify or insert the code to the new field plugin.

Before I try to duplicate the filed "color" to "color copy" and put
Code:
$view = JRequest::getVar('flexi_callview', JRequest::getVar('view', FLEXI_ITEMVIEW)); if ($view==FLEXI_ITEMVIEW) { $field->{$display} = 'color1::color1::Image1.jpg%% color2::color2::Image2.jpg%% color3::color3::Image3.jpg%% color4::color4::Image4.jpg%% color5::color5::Image5.jpg%% color6::color6::Image6.jpg%% color7::color7::Image7.jpg%% color8::color8::Image8.jpg%% color9::color9::Image9.jpg%% color10::color10::Image10.jpg%% color11::color11::Image11.jpg%% color12::color12::Image12.jpg%% color13::color13::Image13.jpg%% color14::color14::Image14.jpg%% color15::color15::Image15.jpg%% color16::color16::Image16.jpg%% color17::color17::Image17.jpg%% color18::color18::Image18.jpg%% color19::color19::Image19.jpg%% color20::color20::Image20.jpg%% color21::color21::Image21.jpg%% color22::labe22::Image22.jpg%% color23::color23::Image23.jpg%% color24::color24::Image24.jpg%% color25::color25::Image25.jpg'; } else { $field->{$display} = 'color1::color1%% color2::color2%% color3::color3%% color4::color4%% color5::color5%% color6::color6%% color7::color7%% color8::color8%% color9::color9%% color10::color10%% color11::color11%% color12::color12%% color13::color13%% color14::color14%% color15::color15%% color16::color16%% color17::color17%% color18::color18%% color19::color19%% color20::color20%% color21::color21%% color22::color22%% color23::color23%% color24::color24%% color25::color25'; }

But I think that I'm wrong.

Sorry~ :oops:
And thank you~!!!

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

More
12 years 1 month ago #29379 by ggppdk
I ll put an extra display variable for checkboximage and radioimage field

i ll call it display_valindex

this will contain the indexes of the checked images

1. so you can just drag and drop field in the "render-only" position
2. manually output it in your template via:
Code:
echo $items[$i]->fields['myfieldname']->display_valindex;


-- 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 #29380 by despair
So I need to add a new field plugin for checkbox image. And modify the XML to add a display_valindex.
So in the template I can output the "value" but not the display "name"?

Thanks for your kindly reply!

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

More
12 years 1 month ago #29384 by ggppdk
I meant i will do (have not done it yet) it it is trivial, to add this variable , you only need to

1. add field in render-only position
2. manually output the variable with
Code:
echo $items[$i]->fields['myfieldname']->display_valindex;


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