LISE sort by item-alias?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
tbremer
New Member
New Member
Posts: 6
Joined: Mon Oct 15, 2018 6:57 pm

LISE sort by item-alias?

Post by tbremer »

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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: LISE sort by item-alias?

Post by Dr.CSS »

Can you explain how you do it with the custom_field..?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1825
Joined: Wed Feb 25, 2009 4:25 am

Re: LISE sort by item-alias?

Post by DIGI3 »

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.
Not getting the answer you need? CMSMS support options
tbremer
New Member
New Member
Posts: 6
Joined: Mon Oct 15, 2018 6:57 pm

Re: LISE sort by item-alias?

Post by tbremer »

Dr.CSS wrote:Can you explain how you do it with the custom_field..?
Yes, it is explained in the LISE-docs:
With fielddef values:
orderby='custom_[fielddef alias]'
For example: orderby='custom_year'
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: LISE sort by item-alias?

Post by velden »

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'.
Post Reply

Return to “Modules/Add-Ons”