Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
some sites have a button "Display as One page" next to the pager.. Is this hard to implement?
Comment | File | Size | Author |
---|---|---|---|
#10 | 1449764-allow-display-as-one-page-fix-for-linebreaks.patch | 1.6 KB | jpstrikesback |
#7 | 1449764_v2_display_as_one_page.patch | 2.88 KB | jtoth624 |
#6 | 1449764_display_as_one_page.patch | 21.65 KB | jtoth624 |
Comments
Comment #1
solodky CreditAttribution: solodky commentedis it hard to include the page number such as Page 2 of 3 up near the node title? ..and also another instance of the pager to complement the pager set at the bottom with another one at the top like a real peace of software?
Comment #2
arpeggio CreditAttribution: arpeggio commentedHi solodky, "Display as One page" is a challenging feature to develop, anyway I'll work on this feature on my free time. Of course, patches are always welcome. The "Page 2 of 3" feature is already implemented #1177620: Page title suffix should not be added via drupal_set_title. Thank you.
Comment #3
chegor CreditAttribution: chegor commentedAnybody can suggest a solution?
Comment #4
jtoth624 CreditAttribution: jtoth624 commentedI am currently implementing this. It's not fully contained within the module though (our "Display as One page" link is not part of the pagination bar) but it provides an option to specify an argument in the URL which disables smart paging for that page. I have a few things to button up on it then I plan to submit a patch.
Comment #5
arpeggio CreditAttribution: arpeggio commentedHi jtoth624, your patch is welcome. Thanks.
Comment #6
jtoth624 CreditAttribution: jtoth624 commentedHere is a patch I created to "display as one page". This will disable smart paging if the argument "single=1" is present in the URL. It also takes the full node URL appended "?single=1" and makes that the canonical link, even when paging is still on. This makes the full page view the landing page for search engine results. If you wish to change the argument name from "single" to something else, be aware that it occurs in 2 locations after the patch is applied, once on line 690, and also on line 1070. One other thing worth noting is that for full view pages, I've disabled caching because it was causing a persistent cached copy to be served, I left the caching code commented out but not removed in this patch because I am not sure if it was problematic specifically due to memcache on our end, or in general.
Comment #7
jtoth624 CreditAttribution: jtoth624 commentedPlease disregard that last patch, I built it on our installed version instead of the latest, this one applies correctly.
I also want to add that if you'd like to add a link to the pager controls directly, you can do so by copying theme_pager() from pager.inc to your template.php file and adding something like the following before the return:
I tried to include this today within the patch but I don't know of a way to override the pager outside of themes.
Comment #8
arpeggio CreditAttribution: arpeggio commentedHi jtoth624, I have already implemented your patch. I made some improvements in your code. Also I changed the URL appended token from
?single=1
to?nopaging=1
. Thank you for sharing your patch.Comment #9
jpstrikesback CreditAttribution: jpstrikesback commentedI'm noticing that the line break filter fails when using
?nopaging=1
, this makes sense since the line break processing happens after we've said return. I've added it back in before the return, thoughts?Comment #10
jpstrikesback CreditAttribution: jpstrikesback commentedHere is a patch
Comment #11
jpstrikesback CreditAttribution: jpstrikesback commentedTo use this should Smart Paging provide it's own theme function that overrides theme_pager()? I've gone the template route but that seems rather brittle, perhaps it's fine:
Inside MY_TEMPLATE_pager() before the return:
Comment #12
jtoth624 CreditAttribution: jtoth624 commentedThis is how I am altering the pager bar too (as I posted in comment #7). I couldn't come up with a way to alter theme_pager() from within a module so I extended it in template.php.
Comment #13
arpeggio CreditAttribution: arpeggio commentedHi jpstrikesback, I have already pushed your patch. Please use the deve version. Thank you for sharing your patch.
@Theme for pager, please open new issue. Thanks.
Comment #15
marcelovaniThis piece of code is causing the canonical rel to be displayed twice, because Metatag module is responsible for setting this
Continuing on https://drupal.org/node/1942266