![dannie](https://xoops.org/uploads/savt3db7afcf2a9d4.gif)
if ($publisher->getConfig('index_display_last_items')) {
// creating the Item objects that belong to the selected category
switch ($publisher->getConfig('format_order_by')) {
case 'title':
$sort = 'title';
$order = 'ASC';
break;
case 'date':
$sort = 'datesub';
$order = 'DESC';
break;
default:
$sort = 'weight';
$order = 'ASC';
break;
}
case 'date':
$sort = 'datesub';
$order = 'DESC';
break;