Using Pager in Lists

Topics: Core, Customizing Orchard, General, Writing modules, Writing themes
Nov 25, 2011 at 9:59 AM

I have the need to place the pager twice in the List page but I can't seem to find the shape in the Model.


Anyone ever displayed more than a pager that may help me?


Thanks in advance


João Reis

Nov 25, 2011 at 11:04 AM
Edited Nov 25, 2011 at 11:05 AM

The problem is this code right here in Orchard.Core.Containers.Controllers.ItemController:


            if (container.As<ContainerPart>().Record.Paginated) {
                model.Content.Add(pagerShape, "7.5");


What's happening is that a single instance of a pager shape is getting pushed directly into the display from the Controller.

Obviously that's not a good thing from an MVC standpoint, a controller action shouldn't be aware of the display, and certainly shouldn't be controlling something as specific as the position of a component in the view.

There was a very recent change in the 1.x branch that moved to containers using a driver to render the list, so I just had a quick look at the code to see if it helped your situation, however it looks like now no Pager shape is surfaced at all. Maybe Piedone can comment on this (he did the changes) - the original thread was

Nov 25, 2011 at 11:08 AM

Thank you randompete, always on top of the subject!

I had noticed that in the controller and was already trying to override the controller action in my theme, however I am having difficulties in doing it and I can't seem to find information on how to override themable controller actions.


João Reis

Nov 25, 2011 at 11:38 AM

Reis, by coincidence someone else is talking today about overriding that same controller:

Nov 25, 2011 at 12:46 PM

Yes, thank you. I was following that thread as well