Here's a Smarty plugin (modifier) to reverse sort arrays. I needed something to reverse the menu order for a client, where the template called for the menu items to be aligned right, which caused them to load from right to left. rather than reorder the pages, which would be confusing for the client, I created this plugin.
Just copy the attached file (rename it to modifier.reverse_array.php) to your lib/smarty/plugins directory.
To reverse sort an array, like $nodelist in your menu template, just change:
Code: Select all
{foreach from=$nodelist item=node}
to:
Code: Select all
{foreach from=$nodelist|@reverse_array item=node}
This will work for single level menus.
Nullig