How to change order of slices in powerslice filter dropdown?

Vote:
 

I implemented powerslice and added some basic slices, but I cant seem to control in what order the slices appear in the dropdown. Implementing the "Order" property on each slice appears to have no affect. Is there another way to order them, and what is this property supposed to do?

#204607
Jun 10, 2019 23:57
Vote:
 

Hi Jason,

Have you overridden the "Order" property?

Refer this article for reference

http://joelabrahamsson.com/powerslice/

Thanks

Ravindra

#204614
Jun 11, 2019 10:53
Vote:
 

Yes, still does not seem to work. They sort in some wonky unpredictable way not matter what I set the order property of my slices to. Here is an example. I have 8 slices all property set to the right order as I want them shown. 

[ServiceConfiguration(typeof(IContentQuery)), ServiceConfiguration(typeof(IContentSlice))]
public class FormsSlice : ContentSliceBase<FormContainerBlock>
{
    public override string Name => "All Forms";

    public override int Order => 2;
}
#207076
Edited, Sep 09, 2019 18:17
Vote:
 

Hi Jason,

You need to override SortOrder.

I was working with this myself recently and noticed the same thing, I also created a pull request to remove the Order property that isn't used at all, hopefully it'll be approved at some point.

#207077
Edited, Sep 09, 2019 19:44
Vote:
 

That was the trick, thanks so much. The documentation should be updated to reflect that, because every post I saw with examples uses the Order property.

#207078
Sep 09, 2019 20:43