Hi

It would be nice to have some control of URL format for the pager.

Maybe I'm unusual but I prefer the format

http://www.example.com/node/123?page=2

rather than

http://www.example.com/node/123/page/2/0

I think ?page=2 logically separates the "what do I want" from the "what part of it do I want".

Is it possible to at least get rid of the /0 ?

Also, I feel that smart_paging should only change the paging for things that it is directly involved with. The way it is, it affects all pagers, including Views. Views by default uses ?page=2 format but smart_paging changes that to /page/2/0. I think smart_paging_url_outbound_alter should only operate on a node page with Smart Paging enabled.

Thanks

Comments

arpeggio’s picture

Hi, I have already implemented "Enable clean URL pagination" option at Smart Paging admin page. It will bypass the hook_url_outbound_alter() and hook_url_inbound_alter() which are responsible for clean URL. However, the javascript pager as progressive enhancement for Drupal native pager and URL paging prefix will work only if "Enable clean URL pagination" is enabled.

Is it possible to at least get rid of the /0 ?

No, because Smart Paging works on second element of Drupal pager system. Therefore, there will always leading pager # which is for the first element of Drupal pager system (comment pager uses this first element). Thanks.

arpeggio’s picture

Status: Active » Fixed
icosa’s picture

Thanks for your response.

I understand about it being the second pager element but why hard code that? I think it would be quite rare to have another pager on a node page hard coded as pager element 0.

For the vast majority of cases, surely smart paging could use element 0. That would make the URLs page/1, page/2, page/3 etc which looks a lot cleaner than page/0/1, page/0/2, page/0/3.

Somehow I missed the 'Enable clean URL pagination". That works well, thanks.

For the majority of cases when there is no good reason to use the second element, surely it would be much nicer to have ?page=3 instead of ?page=0%2C3

arpeggio’s picture

You're welcome.

I understand about it being the second pager element but why hard code that? I think it would be quite rare to have another pager on a node page hard coded as pager element 0.

The comment entity's pager uses the element 0 and we all know that comments are under nodes. If comments reaches the maximum number of comments per page it also generates pager under it. Comment pager is on element 0 and it would have URL pager as page/0, page/1, page/2, etc. We assign Smart Paging on element 1 so that it would not collide with comment's pager. In this case we would have no problem if node's page is already on page 3 while the comment page is on page 2 because we have URL pager as page/1/2 (page/<comment page 2>/<node page 3>).

icosa’s picture

Ahh yes, that makes sense.

I didn't think about the comment pager. I've never used comments. :)

Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.