In all places where I have paginated content, there's a discrepancy between the page number in the URL and the actual page. The current behaviour seems to be: Page number in URL = (Actual page number) - 1.
This could be confusing for users copying/pasting the URL and being taken to a different page number.

I've also been playing around with URL alias settings because the URL is not "clean", so it might be a wrong/missing setup on my side. I'd appreciate any tips.

For example: In the picture below illustrating the problem, how can I automatically turn the URL into ".../page/2", ".../page-2" or something similar?

 

PageNumbers

Most helpful answers

Maybe it's just because the page numbers are zero-based, and the "0" is never shown.

Personally, I never had trouble with that, but I understand the confusion.

I don't think there's an easy workaround for that - never tried, though.

Comments

Yeah, it's weird... Basically, the URL '/home' shows the first page of results. For the second page of results, '?page=1' is appended to the URL. I think this is because appending '?page=2' would make people wonder what happened to 'page=1' (it wouldn't exist). Hence the discrepancy.

As for changing the URLs to show nicer aliases with proper page numbers, I'm not sure if/how you'd do this. Perhaps try looking for a Backdrop (or Drupal) contrib module that does this...?

indigoxela's picture

Maybe it's just because the page numbers are zero-based, and the "0" is never shown.

Personally, I never had trouble with that, but I understand the confusion.

I don't think there's an easy workaround for that - never tried, though.

Thanks @BWPanda, @indigoxela

BWPanda's suggestion to also search drupal made me find further info about the same topic, and it seems it's how it works in drupal.
I'm not using drupal, so maybe that's why it looked a bit more confusing to me :)