Collection filters correct in Backend but wrong in Frontent

The “Backend” shows everything correct.
Ascending by first column.

But in the “Frontend” the first Item is placed last.

Does anybody have an idea why the order is wrong on the Frontend?

Kind regards

Has noone an idea?
Is it a bug or a feature?

hi @Alain you are sorting by alphabet based on House you may sort these rather by Whg Nr instead.

CleanShot 2021-07-02 at 00.19.39

When you sort these by “House” the A has many houses (according to your CMS) so if you do not specify different more specific sort filter they will be sorted automatically by publish day and A1.1 was published first this mean is oldest post and that’s why is on the end (bottom).

Thanks, that was it :slight_smile:

I made it like this:

I still wonder why Designers-View shows different to Frontend.

hi @Alain that I can’t answer right now. But all your items were published at the same day so there were sorted from newest to oldest as they should be. But why WF sort array of const haus = ["A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A"].sort() the way they do and preview it this way I really do not now.

So as you see Haus filter you still using is redundant as you try to sort bunch of A by alphabet. You should use only WhgNr.

But I need to filter the collection by house “A” and then sort the result alphabetically by whg Whg-Nr…
If I only sort by Whg-Nr. then I will get all houses (“A” and “B”).

Hi @Alain you already have Filter: A that will return houses only with haus: A and then sort this return by WhgNr


Thanks Stan for that Javascript-Solution :wink:

1 Like