Hello,
I want to sort the output of LISE by the item-alias.
In the module-help, something like "item_alias" is not listed as a valid orderby-column. And in fact, an orderby with "item_alias" has no effect :-)
My workaround is to define a custom textfield, which could be the target for an orderby. Works, but far away from being perfect and a confusing thing for my backend-users.
Is there a way to prevent the using of the extra custom-field and to sort directly by the item_alias?
Thanks.
LISE sort by item-alias?
Re: LISE sort by item-alias?
Can you explain how you do it with the custom_field..?
Re: LISE sort by item-alias?
You could sort the array before outputting instead of specifying it as a tag parameter. You'd likely need to make a UDT/plugin to do the sorting with the alias as the key.
If it's not a huge amount of data, you could also do it via javascript on the frontend. Just give each div the alias as a data-value or class then sort it on load. Not ideal if you're doing pagination though.
If it's not a huge amount of data, you could also do it via javascript on the frontend. Just give each div the alias as a data-value or class then sort it on load. Not ideal if you're doing pagination though.
Not getting the answer you need? CMSMS support options
Re: LISE sort by item-alias?
Yes, it is explained in the LISE-docs:Dr.CSS wrote:Can you explain how you do it with the custom_field..?
For example: orderby='custom_year'With fielddef values:
orderby='custom_[fielddef alias]'
Re: LISE sort by item-alias?
A few notes:
Item-alias nor item_alias are valid properties of a lise item. 'alias' is though I don't know if it can be used for sorting. But of course you can try.
Sorting in the template like DIGI3 suggests could be a work-around as long as you don't use pagination.
If you're using a custom field it would be rather easy to create a UDT and use an event to auto-fill this field when the item is saved.
I'd start with trying 'alias'.
Item-alias nor item_alias are valid properties of a lise item. 'alias' is though I don't know if it can be used for sorting. But of course you can try.
Sorting in the template like DIGI3 suggests could be a work-around as long as you don't use pagination.
If you're using a custom field it would be rather easy to create a UDT and use an event to auto-fill this field when the item is saved.
I'd start with trying 'alias'.



