Sort tags alphabetically
Permalink Browser Info Environment
Perhaps this question has been posted and answered a zillion of times, but my research did not give me any result. Is it possible to sort the tags alphabetically? What I see in the blocked installed deals with «pages».
Type: | Discussion |
---|---|
Status: | New |
I have found a crude way to do this. I am not very familiar yet with either php or Concrete5 API. Instead of concatenating the output, I sort the elements set in two arrays using the function array_multisort.
Viewing 15 lines of 16 lines. View entire code block.
This code works with 5.6
Here is the whole view:
Here is the whole view:
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <div class="ccm-tags-display"> <?php if(strlen($title)) { ?><h4><?php echo $title ?></h4><?php } if($options instanceof SelectAttributeTypeOptionList && $options->count() > 0) { foreach($options as $opt){ $data[] = $opt; } function cmp($a, $b) { return $a->value - $b->value; } usort($data, 'cmp'); $options = $data; natsort($options);
Viewing 15 lines of 25 lines. View entire code block.
That is very kind of you. Thank you!
agreed. kudos!
ChadStrat
ChadStrat