OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Taxonomy items rendered in alphabetical order regardless of hierarchy when autocomplete is selected #8131

Open luciofassio opened 5 years ago

luciofassio commented 5 years ago

I'm using Orchard/Laser/1.10.x. Languages set in Orchard are italian and french, italian is the default one. I created a hierarchical taxonomy with the import function (in both italian and french) and added a taxonomy field to Page content item. When autocomplete is set in the taxonomy field the item list is ordered alphabetically regardless of the hierarchy; when autocomplete is off the item list is rendered correctly. It happens in all the languages.

chrome_2018-10-19_15-50-34 chrome_2018-10-19_16-44-19 chrome_2018-10-22_10-00-11

HermesSbicego-Laser commented 5 years ago

Hi @luciofassio, from what I see you're using a branch of our fork, I imagine because you need O1.10 working with a full integrated localization feature. Our branch is an Hybrid: it's 1.10.x + some feature of dev (cloning, concurrency, etc...). By the way, from what I see the devbranch also is affected by this, see https://sourcegraph.com/github.com/OrchardCMS/Orchard@dev/-/blob/src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/TagsController.cs?utm_source=share#L52:1. What I don't know is if that beahaviour (Alphabetical order) is by design or there is an issue there so we should order by term hierarchy/weight/label... @sebastienros ?

sebastienros commented 5 years ago

Maybe an option in the field? Because I don't think there is a unique solution to this.

HermesSbicego-Laser commented 5 years ago

I agree that we need an option,here...More, the autocomplete acts as filter so we need something like https://stackoverflow.com/questions/11432024/jquery-text-input-autocompletion-for-a-tree-of-values @luciofassio have you any jquery plugin in mind to do that?

luciofassio commented 5 years ago

jQueryUI Autocomplete would work well but also what is implemented now does, the issue i see is that when i start typing the item list which is rendered is not properly ordered, a sort option in the taxonomy field would work well i guess