Skip to content

Instantly share code, notes, and snippets.

@justrjlewis
Last active January 3, 2016 17:48
Show Gist options
  • Save justrjlewis/8497697 to your computer and use it in GitHub Desktop.
Save justrjlewis/8497697 to your computer and use it in GitHub Desktop.
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
//a-o concrete5 v5.6.2.1::copy the tags folder from concrete/blocks/tags to the root blocks folder and replace the view.php code with this code.
<div class="ccm-tags-display">
<?php if(strlen($title)) {
?><h4><?php echo $title ?></h4><?php
}
if($options instanceof SelectAttributeTypeOptionList && $options->count() > 0) {
?><ul class="ccm-tag-list">
<?php foreach($options as $opt) {
$data[] = $opt;
}
function cmp($a, $b) {
return $a->value - $b->value;
}
usort($data, 'cmp');
$options = $data;
natsort($options);
foreach($options as $opt) {
$qs = $akc->field('atSelectOptionID') . '[]=' . $opt->getSelectAttributeOptionID();
?><li <?php echo ($selectedOptionID == $opt->getSelectAttributeOptionID()?'class="ccm-tag-selected"':'')?>><?php if ($target instanceof Page) { ?>
<a href="<?php echo $navigation->getLinkToCollection($target)?>?<?php echo $qs?>"><?php echo $opt ?></a><?php } else { echo $opt; }?></li><?php
}?>
</ul>
<?php } ?>
<div style="clear: both"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment