Cataloger - choose sort order for items in loop
Posted: Wed Dec 12, 2012 11:11 am
				
				I am a smarty/php newbie using Cataloger (version 0.11.2) and would like to control the sort order when showing posts in a Printable Catalog. Right now I have to change it manually under Pages with the "Reorder pages" mode... I get no effect from the settings in "Global Catalog Operations" and "Manage Preferences"... and would prefer choosing sorting order in the templates, using my user-defined-attribute "Year", $items[numloop].year
Can I add a command for sorting order in the following code?
			Can I add a command for sorting order in the following code?
Code: Select all
{section name=numloop loop=$items}
{if $items[numloop].typ == 'Verk'}
<td style="width: 650px;"><h2><a href="{$items[numloop].link}"><img src="{$items[numloop].image}" width="100px" style="float:left; padding-right:15px;" title="{$items[numloop].title}" alt="{$items[numloop].title}"/>
{$items[numloop].title}</a>{if $items[numloop].lyssning == "Ja"}  <img src="img/lyssning.png"/>{/if}</h2>
{foreach from=$attrlist item=attr key=k}
{$items[numloop][$k]}
{/foreach}
{/if}
</td>
        {if not ($smarty.section.numloop.rownum mod $cols)}
                {if not $smarty.section.numloop.last}
                        </tr><tr>
                {/if}
        {/if}
        {if $smarty.section.numloop.last}
                {math equation = "n - a % n" n=$cols a=$items|@count assign="cells"}
                {if $cells ne $cols}
                {section name=pad loop=$cells}
                        <td style="width: 200px;"> </td>
                {/section}
                {/if}
                </tr>
        {/if}
   {/section}
</table>