Last active
April 22, 2022 08:58
-
-
Save biplobice/c06e66619b6d209b6638a9738b5fb685 to your computer and use it in GitHub Desktop.
A simple hack to support tabbed navigation both on Concrete CMS v8.X & v9.X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('C5_EXECUTE') or die('Access Denied.'); | |
// @see https://documentation.concretecms.org/tutorials/using-tabbed-panels-in-concrete5-5-7 | |
echo Core::make('helper/concrete/ui')->tabs([ | |
['feed-details', t('Feed Details'), true], | |
['feed-settings', t('Feed Settings')], | |
['text-colors', t('Text and Colors')], | |
]); | |
?> | |
<div class="tab-content"> | |
<div id="feed-details" class="tab-pane show active" role="tabpanel"> | |
<div class="form-group"> | |
<?php echo $form->label('text1', t('Text 1')); ?> | |
<?php echo $form->text('text1', $text1)?> | |
</div> | |
</div> | |
<div id="feed-settings" class="tab-pane" role="tabpanel"> | |
<div class="form-group"> | |
<?php echo $form->label('text2', t('Text 2')); ?> | |
<?php echo $form->text('text2', $text2)?> | |
</div> | |
</div> | |
<div id="text-colors" class="tab-pane" role="tabpanel"> | |
<div class="form-group"> | |
<?php echo $form->label('text3', t('Text 3')); ?> | |
<?php echo $form->text('text3', $text3)?> | |
</div> | |
</div> | |
</div> | |
<?php | |
// v8 compatibility | |
if (Config::get('concrete.version_installed') < 9) { | |
?> | |
<script> | |
$('.tab-pane').each(function () { | |
$(this).removeClass('active').attr('id', 'ccm-tab-content-' + $(this).attr('id')); | |
if ($(this).hasClass('show')) { | |
$(this).removeClass('show').show(); | |
} | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://documentation.concretecms.org/tutorials/using-tabbed-panels-in-concrete5-5-7