bitmatrixstudio / craft-omnisearch

A powerful control panel search filter replacement for CraftCMS
Other
5 stars 0 forks source link

How does structure reordering work when a category is selected? #8

Closed outline4 closed 3 years ago

outline4 commented 3 years ago

Hi,

What exactly happens when reordering within a category?

Here's an example:

Global Order:

item 1 - cat 1
item 2 - cat 2
item 3 - cat 1
item 4 - cat 2

now I reorder item 4 before item 2 with cat 2 selected:

item 4 - cat 2
item 2 - cat 2

where is item 4 in the global order?

is it:

item 1 - cat 1
item 4 - cat 2
item 2 - cat 2
item 3 - cat 1

or:

item 4 - cat 2
item 2 - cat 2
item 1 - cat 1
item 3 - cat 1

or:

item 1 - cat 1
item 3 - cat 1
item 4 - cat 2
item 2 - cat 2

Maybe this is a stupid question?!

Cheers
Stefan

pohnean commented 3 years ago

Sorry... is this a general question about Craft, or a question about the plugin? I'm not sure what your question is about.

outline4 commented 3 years ago

Ha ha, I told you that maybe it's a stupid question.
I will maybe have to make some tests on my own.

For me it's not clear what happens when you reorder structure entries while a filter is set. What happens with the elements that are not displayed?

pohnean commented 3 years ago

Okay, I tested this and this is what actually happens... It will become:

Very strange result! I think it's probably best not to reorder when searching...

pohnean commented 3 years ago

Looks like Craft CMS will also disable reordering when you have a search filter present (when using the default search box)

pohnean commented 3 years ago

I will be adding a patch to disable reordering of structures when omnisearch filters are enabled.

pohnean commented 3 years ago

Fixed in 1.0.8

outline4 commented 3 years ago

Can you please make this available again, since this is the main reason we are using this plugin! At least as an option?

pohnean commented 3 years ago

You mean you want to reorder while there are active filters? I've tested it and it will mess up your structure orders. I don't really think that's a good idea right?

outline4 commented 3 years ago

It won't mess the order from within a category, not?
In that project, I never display uncategorized entries.

I thought this was a great plus!

pohnean commented 3 years ago

Well if you look at the example you gave...

item 1 - cat 1 item 2 - cat 2 item 3 - cat 1 item 4 - cat 2

After you reordering item 4 before item 2 with cat 2 selected, it becomes: Item 4 Item 1 Item 2 Item 3

It should become: Item 1 Item 4 Item 3 Item 2

This has the potential to totally mess up your navigation menu structure if you accidentally change it... I think this is why when you use the native search function, CraftCMS also disables the reordering function...

May I understand why it is necessary to filter and then reorder?

outline4 commented 3 years ago

If you ONLY view it from a categories viewpoint, it's still correct:

viewing cat2: item 4
item 2

viewing cat1:
item 1
item 3

In both cases it's correct, and that's the main point.
I don't mind if it messed up the global order, since I will never display the global order in the frontend.
Please make this available again.

pohnean commented 3 years ago

okay then

pohnean commented 3 years ago

Hey Stefan,

this feature has been reverted. Check out 1.1.1.

outline4 commented 3 years ago

Thanks, it works again (~‾▿‾)~