[%- USE scalar -%] [%- WRAPPER site_wrapper.html title = 'Tags' -%] [%- SET p = c.req.query_params result = list_tags( p ) tags = result.rows -%]
[% IF result.total > 0 %]
[% IF result.params.sort == 'alphabetical' %]

### Tags (alphabetical)

Sort by popularity [% ELSIF result.params.sort == 'recent' %]

### Tags (most recently used)

Sort alphabetically [% ELSE %]

### Tags (by popularity)

Sort by most recent [% END %]

[% FOREACH tag IN tags %]
- [% tag.name %] ([% tag.posts_count %])
[% END %]

[% ELSE %]

#### No tags found.

[% END %]
[% END %]