Sorting on Alias

More
7 years 10 months ago #62297 by Ninjakitten
Sorting on Alias was created by Ninjakitten
I'd love to be able to sort on an item's alias. Currently it doesn't seem to be an option either in the default list of options or as a custom field.

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago - 7 years 10 months ago #62298 by ggppdk
Replied by ggppdk on topic Sorting on Alias
Hello

it is trivial to add, but why would we add this ?

it sounds very uncommon, also how would you call / "name" this sorting option ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 7 years 10 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago - 7 years 10 months ago #62299 by Ninjakitten
Replied by Ninjakitten on topic Sorting on Alias
It probably is pretty uncommon! There are situations where it can be useful, though.

In my case, I have items sorted by a custom date field. Sometimes the items have the same date -- and the order within that date still matters. My aliases all follow a specific format which ends with the date (essentially, category1-category2-20160527) and if there's more than one on a date, they get a letter added to the end (so the second would end with -20160527b, the third with -20160527c, etc.). Currently, I have to arrange them in both their categories by hand so that they get returned in the correct order. If I could use the alias as my secondary sorting criterion, I wouldn't need to do that anymore.

I'd probably call it 'Alias - Ascending' and 'Alias - Descending'.
Last edit: 7 years 10 months ago by Ninjakitten. Reason: Typo.

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #62300 by ggppdk
Replied by ggppdk on topic Sorting on Alias
Hello

ok, will add this to category-based views and universal module

since it is trivial work to add
no performance issue
and by default it will not be shown in frontend selector (user must configure it for it to appear in frontend selector)

Language strings will be:

FLEXI_ORDER_ALIAS="Item code (alias)"
FLEXI_ORDER_ALIAS_REVERSE="Item code (alias) Reverse"


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
The following user(s) said Thank You: Ninjakitten

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #62304 by Ninjakitten
Replied by Ninjakitten on topic Sorting on Alias
Thank you! It'll be very handy for me in my category and search result views. :)

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #62305 by Ninjakitten
Replied by Ninjakitten on topic Sorting on Alias
I've just tested the current 3.1 dev version since I saw it said the alias sorting was the latest change, and although I know it's all being busily worked on I wanted to let you know that the alias sort doesn't quite work yet -- it looks like it's because it's trying to get the alias from #__flexicontent_items_tmp and there's no alias column there.

Error message:
1054 - Unknown column 'i.alias' in 'order clause' SQL=SELECT SQL_CALC_FOUND_ROWS DISTINCT i.id FROM #__flexicontent_items_tmp AS i JOIN #__flexicontent_types AS ty ON i.type_id = ty.id JOIN #__flexicontent_cats_item_relations AS rel ON rel.itemid = i.id JOIN #__categories AS c ON c.id = i.catid LEFT JOIN #__flexicontent_fields_item_relations AS f ON f.item_id = i.id AND f.field_id=17 WHERE 1 AND rel.catid IN ('89') AND ( i.state IN (1, -5) ) AND ( ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= UTC_TIMESTAMP() ) ) AND ( ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= UTC_TIMESTAMP() ) ) AND ( i.language LIKE 'en%' OR i.language="*" ) AND ty.access IN (0,1,1,5) AND c.access IN (0,1,1,5) AND i.access IN (0,1,1,5) ORDER BY CAST(f.value AS DATE) ASC, i.alias ASC, i.title LIMIT 0, 10

I don't expect this to be your major priority or anything, but I thought I should let you know. :)

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.281 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline