Collapsible Columns for Fields

More
3 years 3 months ago - 3 years 3 months 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:
<?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
'<div class="small-12 medium-4 columns">'
- so you may need to alter to bootstrap or whatever...
Attachments:
Last edit: 3 years 3 months ago by iamrobert.

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

More
3 years 3 months 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 review. Thanks!

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

More
3 years 3 months 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.

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

More
3 years 3 months 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
© 2018 Flexicontent. All Rights Reserved.