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.
I am using Ajax pager to display content, three items per page.
When I click on the next button to load the next three items, the items load but I am still stuck at the bottom of the page. My understanding is that it should smooth scroll back up to the top of the view so the user can see the first item.
Comment | File | Size | Author |
---|---|---|---|
#13 | ajax_pager_scroll_top-1233334-13.patch | 2.07 KB | stBorchert |
Comments
Comment #1
dawehnerWhat kind of view do you use? Is it a content pane display?
Comment #2
matthewdolman CreditAttribution: matthewdolman commentedIt is a page, placed in the main content block of a page.
Comment #3
dawehnerIn general i suggest you to use content pane as display type.
Can you verify whether the bug still exist with this?
Comment #4
dawehnerIn general i suggest you to use content pane as display type.
Can you verify whether the bug still exist with this?
Comment #5
matthewdolman CreditAttribution: matthewdolman commentedI'm sorry I don't understand.
When I create the view I get various options like Block, Feed, Page Etc
This is a Page, and I set the URL in which it displays.
I don't see any options for "Display Type" for which I can change to "Content Pane"
I'm sorry if I am missing something obvious
Comment #6
dawehnerYou would have to create a new display.
Comment #7
matthewdolman CreditAttribution: matthewdolman commentedI create a new Display of type Page
Nowhere can I see the option for "Display Type"
Again, I'm sorry if I am being dense
Comment #8
dawehnerThen the question is, did this display type worked for you as expected?
Comment #9
esmerel CreditAttribution: esmerel commentedCan you give us a link to what you are seeing?
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedi'm having the same problem. i have made a view with 20 teasers per page, but when i choose ajax, i have to scroll to the top to see the first teasers of the next side. i know how to add contentpanes (adding a display on the top of the view/edit area), but thats not a solution for me...
any ideas?
thanks
konsul
Comment #11
aschiwi CreditAttribution: aschiwi commentedTo reproduce, create a View with a page display, set Ajax to yes and use a pager. You scroll down to the pager, hit page 2, it loads page 2, but stays at the bottom of the View. It doesn't matter whether it's a page display or a content pane on a Panels page.
I tested this in a brand new Drupal 7 install with 7.x-3.0-rc3. I tested in an existing Drupal 6 website, and it worked back then, going to page 2 scrolls the View back up.
Comment #12
aschiwi CreditAttribution: aschiwi commentedThere's another report of this at http://drupal.org/node/1209086 (which I marked as duplicate)
Comment #13
stBorchertHere is a small patch that re-implements the "scroll-top" behavior for AJAX pagers.
Comment #14
aschiwi CreditAttribution: aschiwi commentedPatch in #13 works for me - fresh Drupal install, today's Views 7.x-3.x branch, enabled front page view, created some nodes and set front page view to Ajax. Using the pager now allows me to scroll up. Let's get at least one other opinion though before RTBC.
Comment #15
dawehnerThis patch looks really fine, so committed to 7.x-3.x
Saw this pager working directly
Comment #16
bryancasler CreditAttribution: bryancasler commentedWoot! Thanks stBorchert.
Comment #18
hachreak CreditAttribution: hachreak commentedCan we port this functionality for D6? :)