Grouped Fields: Maintain Multiple Values Per Field?

More
6 years 1 month ago #74775 by Dave LeDev
I'm looking to either bind two fields within a DIV container or support multiple values per field within a group. So for such an odd case, I assume I'd have to make 2 different layouts for values:
  1. One layout to start the DIV tag on one field
  2. One layout to close the DIV container on the second field
Any other ideas, or would this be the best approach?

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

More
6 years 1 month ago #74807 by Dave LeDev
Upon further experimentation, I realized any templating performed at the value level wouldn't be sufficient to create a container for my fields. I would need to be able to make a template override at the field level, but I can't seem to find a feature to let me do that.

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

More
6 years 1 month ago #74810 by ggppdk
Hello

every field inside the fieldgroup is a real field
- go to the fields manager, find the field and create / use a custom layout for it


-- 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
6 years 1 month ago #74832 by Dave LeDev
Unless I've overlooked something, Fieldgroup forces me to have each field dependent upon the group, as shown:


I want to be able to have fields grouped but independent of the group, somewhat like so:



This topic is somewhat related to this one , and depending on the solution in the other thread, it may solve my problem here.

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

More
6 years 1 month ago #74836 by ggppdk
Hello

Currently only 3 fields exist, that can do what you suggest

select multiple
checkbox
checkbox image

the above allow multiple option per value, and inside a field-group they allow multiple option per value


-- 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
6 years 1 month ago - 6 years 1 month ago #74838 by Dave LeDev

the above allow multiple option per value, and inside a field-group they allow multiple option per value

I'm unable to find this functionality. Currently I'm only finding multiple options per group, not per value, as shown here:


I found a patchy solution that does this for the front-end. For the form portion micker pointed me towards Groupmarker (further detailed on Facebook) ; I still need to experiment with it, but that's a lower priority for now. For the front-end, I had to make a conditional statement to create open and close container tags for fields. The check isn't foolproof, but for now it serves its purpose. Having all the field names in arrays makes it simpler to edit if I ever change the field names themselves.

\components\com_flexicontent\templates\items-tabbed-1\item_html5.php (a clone of a core template)
Code:
<?php if (isset($item->positions[$tabpos_name])): ?> <!-- tab start --> <div id="<?php echo $tab_id; ?>" class="tabbertab"> <h3 class="tabberheading"><?php echo $tabpos_label; ?></h3><!-- tab title --> <div class="flexi lineinfo"> <!-- start check if fields for containers exist --> <?php $fieldCheck = 0; $fieldOpen = array( "social-favorite-food-most"); $fieldClose = array( "social-favorite-food-least"); foreach ($item->positions[$tabpos_name] as $field) : if (in_array($field->name, $fieldOpen) || in_array($field->name, $fieldClose)): $fieldCheck++; endif; endforeach; ?> <!-- end check if fields for containers exist --> <?php foreach ($item->positions[$tabpos_name] as $field) : ?> <!-- container open start --> <?php if ($fieldCheck % 2 == 0 && in_array($field->name, $fieldOpen)): ?> <div class="flexi field-container"> <?php endif; ?> <!-- container open end --> <div class="flexi element field_<?php echo $field->name; ?>"> <?php if ($field->label) : ?> <span class="flexi label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <div class="flexi value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div> <!-- container close start --> <?php if ($fieldCheck % 2 == 0 && in_array($field->name, $fieldClose)): ?> </div> <?php endif; ?> <!-- container close end --> <?php endforeach; ?> </div> </div> <!-- tab end --> <?php endif; ?> <?php endif; ?> <!-- container close end --> <?php endforeach; ?> </div> </div> <!-- tab end --> <?php endif; ?>
If a container field existed, this would be a LOT easier. *laughs*
Last edit: 6 years 1 month ago by Dave LeDev.

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

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