listSort

generates a menu for sorting the listing object.

@t(listSort{ Buttons })

Options

This tool requires a set of button definitions to be passed as option.
Each button requires two parameters: sortItem & sortOrder

@t(listSort{
    "Button 1": { 
        sortItem: "title", 
        sortOrder: "asc" 
    },
    "Button 2": { 
        sortItem: "title", 
        sortOrder: "desc" 
    },
    ...
})

sortItem can be any page variable. sortOrder can be "asc" or "desc".

To have a button to sort the pages by its directory name, the sortItem just has to be skipped or set to any non-existing variable:

@t(listSort{
    "Original Order": { 
        sortOrder: "asc" 
    },
    "Title": { 
        sortItem: "title", 
        sortOrder: "asc" 
    },
    ...
})
See also