Edit your category page template's "Content (subcategory_listing)" section and put this code before where it starts looping the sub categories.
Code:
<mvt:assign name="l.elements" value="miva_array_elements(l.settings:subcats)" />
<mvt:while expr="l.counter LT l.elements">
<mvt:assign name="l.counter" value="l.counter + 1" />
<mvt:assign name="l.struct" value="l.settings:subcats[l.counter]" />
<mvt:assign name="l.struct:namesort" value="toupper(l.struct:name)" />
<mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" />
</mvt:while>
<mvt:assign name="l.settings:subcats" value="l.settings:newlist" />
<mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:subcats,':namesort', 1)" />
The first arg is the array variable, as a variable.
The second arg is the array subelement but you have to have single quotes around it and it needs to start with a colon :
The last arg is the sort direction as simply a 1 or -1 where 1 is a-z and -1 is z-a
Leave a comment: