0

I can't seem to be able to sort Asset files by their title, instead only by their filename through orderby="name".

Is it possible to use the Title field for ordering?

1

Nope. According to the docs you can only order by file_id, name, folder, date, and size.

| improve this answer | |
0

Thanks to Pixel & Tonic support, the below alteration to the plugin can support this, in case anyone is interested.

third_party/assets/libraries/Assets_lib.php:765

Replace

$order_by = in_array(strtolower($order_by), array('name', 'folder', 'date', 'size', 'file_id', 'date_modified')) ? strtolower($order_by) : false;

With

$order_by = in_array(strtolower($order_by), array('name', 'folder', 'date', 'size', 'file_id', 'date_modified', 'title')) ? strtolower($order_by) : false;

Then in the switch statement on line 913, add the following:

case 'title':
{
    $sql .= 'ORDER BY exp_assets_files.title ' . $order_type;
    break;
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.