Sorting on Alias

More
9 years 8 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
9 years 8 months ago - 9 years 8 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 review. Thanks!
Last edit: 9 years 8 months ago by ggppdk.

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

More
9 years 8 months ago - 9 years 8 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: 9 years 8 months ago by Ninjakitten. Reason: Typo.

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

More
9 years 8 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 review. Thanks!

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

More
9 years 8 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
9 years 8 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.

More
9 years 8 months ago #62306 by ggppdk
Replied by ggppdk on topic Sorting on Alias
I forgot that our "temporary" table does not have the "alias" column,

i ll disable the alias sorting option for now ...
at least i took chance to update our 'fcordering' parameter element, so the change to disable it will be in 1-2 files


-- 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 review. Thanks!

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

More
9 years 8 months ago #62370 by ggppdk
Replied by ggppdk on topic Sorting on Alias
Hello

i have added the alias column to the temporary table and tested it too

please re-download
github.com/FLEXIcontent/flexicontent-cck/tree/3.0.x-stable

and re-test in a testing web-site


-- 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 review. Thanks!

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

More
9 years 8 months ago #62385 by Ninjakitten
Replied by Ninjakitten on topic Sorting on Alias
Thank you -- I downloaded the linked version and alas it didn't work, but after a little poking I suspected it might not actually be the right one. I found flexicontent-cck-8bc2cda2bf8b4dc150221bd32799a8d473d94d19.zip and tried it as well.

On that one, it seems to be working in both the category-based lists of items and the search results! I only noticed one tiny issue so far, which is just that it doesn't yet have the option to pick alias/alias reverse in the search menu item. This isn't a problem for me, since I can just 'use global', but someone in future might need it.

I've also run into a tangentially-related issue, not new -- is there any good way to tell a search on a custom date field to put items without that field at the end rather than the beginning of the results? One of my types doesn't have the custom date field the other items are primary-sorted by, and I'd like those to show up at the end instead of the beginning.

Thank you again for all your work and help!

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

More
9 years 8 months ago #62392 by ggppdk
Replied by ggppdk on topic Sorting on Alias
Hello

about search order in menu item not showing the option
- we replaced all ordering parameters with the update parameter "fcorder"

will do the same in search menu too, since it does support all ordering
but e.g. in relation field , the field does not support all orderings

effectively all ordering are supported for:
- all category based views
- search view (will update the menu item parameter)
- universal content module

about custom display of search view
- to change the order you need to do a JOOMLA TEMPLATE overrided for file:

component/com_flexicontent/views/.search/tmpl/default_results.php
as
templates/JOOMLA_TMP_NAME/html/com_flexicontent/search/default_results.php


-- 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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
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
Save