A - Z Artist / Profiles page - Audio Pro
Design and Skin Customization
Same thing as the ABC's put a link on the column headers with a sort by parameter
{$base_url = jrCore_strip_url_params(jrCore_get_current_url(), array('sort_by'));}
<a href="{$base_url}/sort_by=genre_desc">Genre</a>
Its better to do that kind of logic stuff in a module on the php side of things before getting to the template in order to keep the templates simpler, but it will work in a template too.
Then you'll need a couple of IF/ELSE to determine whether the link should be DESC or ASC
Docs: Template Blocks
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/3126/template-blocks
{if $_post['sort_by'] == 'genre_desc' }
<a href="{$base_url}/sort_by=genre_asc">Genre</a>
{else}
<a href="{$base_url}/sort_by=genre_desc">Genre</a>
{/if}
and use that sort_by in the jrCore_list
Docs: jrCore_list: Order By
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/89/jrcore-list#order-by
{jrCore_list ....... order_by="audio_genre desc"}
{if $_post['sort_by'] == 'genre_asc'}
{jrCore_list ....... order_by="audio_genre asc"}
{elseif $_post['sort_by'] == 'genre_desc'}
{jrCore_list ....... order_by="audio_genre desc"}
{else}
{jrCore_list .......}
{/if}
updated by @michael: 05/24/20 07:06:42PM