Collapsible Columns for Fields

More
9 years 1 week ago - 9 years 1 week ago #53749 by iamrobert
In Joomla templating we have collapsible template positions .

We can do this is out flexicontent item.php file. If you have 3 fields that you want in the "below" position in the FLEXIcontent template
+ design (col 1)
+ interactive (col 2)
+ strategy (col 3)



and some items have use only 1, 2 or 3 columns - so we want it to collapse.

Our code would be as follows:
Code:
<?php $sum = 0; foreach($item->positions['below'] as $field) { $sum ++; } ?> <?php if (isset($item->positions['below'])) : ?> <div class="row"> <?php foreach ($item->positions['below'] as $field) : ?> <?php if ($sum ==3) { echo '<div class="small-12 medium-4 columns">'; } elseif ($sum ==2) { echo '<div class="small-12 medium-6 columns">'; }else { echo '<div class="small-12 columns">'; } ?> <?php if ($field->label) : ?> <h3><?php echo $field->label; ?></h3> <?php endif; ?> <?php echo $field->display; ?> </div> <?php endforeach; ?> </div> <?php endif; ?>

I am using Zurb Foundation
Code:
'<div class="small-12 medium-4 columns">'
- so you may need to alter to bootstrap or whatever...
Attachments:
Last edit: 9 years 1 week ago by iamrobert.

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

More
9 years 1 week ago #53750 by ggppdk
- Much of late work is on templating configuration,
now need to freeze feature adding in v3.0 and

release v3.0 BETA6 now
then v3.0 RC with bugfixes
then v3.0 RC will be made final


frontend templating revising is next thing to do,
it is not too much work, but it is important work

just it should be in v3.1 BETA

thanks for contribution/suggestion, yes this should be employed everywhere


-- 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
9 years 1 week ago #53755 by iamrobert
Thanks - I was more making a note for myself - in the future when I need to write template(s) to remember the code.
The following user(s) said Thank You: micker

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

More
9 years 1 week ago #53762 by micker
great propose mauybe you can do some pull request for template design in 3.1

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.

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