1

I added a pager to a site I'm working on and the URL for a page comes out to: http://example.com/blog/0%2C0%2C0%2C0%2C0%2C5 which is an encoded version of */0,0,0,0,0,5. However, I'd like the URL to be http://example.com/blog/5 or similar.

I'm using Drupal 7.31 and have clean URLs enabled.

1
  • You will have to provide more information. Are you stating that Drupal is creating a strange URL alias? If so, are you using Path Auto? Or perhaps you mean that the URL of the page number shows up incorrectly? Feb 6, 2015 at 4:22

1 Answer 1

1

It sounds like you have a "Pager ID" value set in your view. From your example my guess is that it's set to "6" instead of the default "0". Check within the "Pager Options" of your view display to see if this is the case, and if so, change that value to 0 to restore the URL to a more standard form.

It's important to note that there are of course some situations where your need this pager ID to be set, notably if you have multiple views, each with pagers, displayed on the same page. If this is the case, and you have to use a pager ID > 0 on one of your views, you could set it on your "secondary" view (the one users are less-likely to page through) and leave it at 0 for the "main" view.

It also looks like you have the "Clean Pagination" module installed, or something similar? Normally I think a paged URL would have the pager query string (?page=#) exposed, so you must be doing some special clean URL processing for that. Still, I think the "Pager ID" notes above would apply regardless.

2
  • Yes, this was it. I changed the pager ID back to 0 and the pager didn't render. Any way to track which view is overriding that? In the meantime, I lowered it to 1, so the new URL is example.com/blog/0%2C1. I am using Clean Pagination, but this doesn't affect the issue at hand. Feb 6, 2015 at 15:07
  • Good to hear that isolated things. It sounds like you have a case where the pager ID is needed to avoid conflicts with other views pagers on the same page (there would be problems if multiple pagers tried to use the same "?page=#" query string). Perhaps you have a separate paged view added in a block or something like that? It probably would not hurt to disable Clean Pagination until you have things setup 100% the way you want, as it's always good to minimize variables.
    – rjacobs
    Feb 6, 2015 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.