Topics: Core, Customizing Orchard, Writing modules
Jan 5, 2012 at 12:53 PM

Here is the scenario.


I have a Content Type that I use as a container to other Content Type through the Container/Containable parts respectively. The fact the the list order property choice is very limited I figured I could do something about it and order the items by a custom part that I created for the List Content Type and I thought I would be able to override the dependency "Orchard.Core.Containers.Extensions.ContentQueryExtensions" to change the method without having to change Orchard.Core but this did not work...

I figured this is something I can't override but is there another way around this to make the list items sortable by a custom part property?

Jan 5, 2012 at 6:04 PM

ContentQueryExtensions isn't a dependency - it's a static class that provides extension methods. You'd have to override other parts of the Containers module, probably the ContainerPartDriver which was added in a recent changeset.

Jan 5, 2012 at 6:16 PM

Yes, I figured as much but I tried anyway. Afterwards I attempted to override the controller (which is what is calling the Order method I need to change) but was having trouble because of routes. Meanwhile I had to put it on hold because something else came up, I will get back on track tomorrow

Jan 5, 2012 at 6:23 PM

The Route scenario will be changing massively with Autoroute and will be much easier to customise/override. However the latest 1.x branch has a ContainerPartDriver which you can override, and as far as I know the ordering code has been moved there.