Sorting tag cloud

I want to have the "Browse by Tag" tag cloud sortable both A-Z and by popularity. I do not know PHP, so I am quite the novice.

Is there a simple way to do this?

Thank you.

In my tags.php file in my theme's item folder I have the following code:

<ul class="navigation item-tags" id="secondary-nav">
      <li>  <a href="<?php echo html_escape(current_uri(array('sort'=>'alpha'))); ?>"<?php if($_GET['sort'] == 'alpha') echo ' class="current"'; ?>>Alphabetical</a></li>
	<li>  <a href="<?php echo html_escape(current_uri(array('sort'=>'most'))); ?>"<?php if($_GET['sort'] == 'most') echo ' class="current"'; ?>>Most</a></li>
        <li><a href="<?php echo html_escape(current_uri(array('sort'=>'least'))); ?>"<?php if($_GET['sort'] == 'least') echo ' class="current"'; ?>>Least</a> </li>
        <li><a href="<?php echo html_escape(current_uri(array('sort'=>'recent'))); ?>"<?php if($_GET['sort'] == 'recent') echo ' class="current"'; ?>>Recent</a></li>

</ul>

Thanks. The Seasons theme does not have a tags.php in the items folder. I will try to figure out the right place to put the code.

r b - the tags.php file is in application >> views >> scripts >> items. Copy the file into the items folder in your Seasons directory and make edits to that file, rather than the one in the Application directory. The Seasons file will override the other one. This is just an easy way to keep all your changes in one place, without changing the base code.

I'm interested in doing this as well. Andy, thank you for the code. I tried adding it and it doesn't work for me unfortunately. Nothing after the code shows up on the page. Which version of Omeka are you using? I'm using 2.1.1.

Thanks kecan. I am using 2.1.1. Code does not work for me either.

I'm running an older version of Omeka. When I implemented this I noticed I could sort on the admin page of my site. Just looking at the github for 2.1.1 it looks like you can still do this in admin. From https://github.com/omeka/Omeka/blob/master/admin/themes/default/tags/browse.php

<div id="tags-nav">
<?php
            $sortOptions = array(
                __('Most') => array('sort_field' => 'count', 'sort_dir' => 'd'),
                __('Least') => array('sort_field' => 'count','sort_dir' => 'a'),
                __('Alphabetical') => array('sort_field' => 'name', 'sort_dir'=> 'a'),
                __('Recent') => array('sort_field' => 'time', 'sort_dir' => 'd')
            );

            foreach ($sortOptions as $label => $params) {
                $uri = html_escape(current_url($params));
                $class = ($sort == $params) ? ' class="current"' : '';

                echo "<span $class><a href=\"$uri\">$label</a></span>";
            }
?>

That might work for you.