Allow pager to link to #fragment attributes

Created on 28 September 2011, about 13 years ago
Updated 9 January 2024, 12 months ago

On node view pages, the comments are shown below the node text, and this is sometimes very far down on the page (if the node body tekst is long). The pager below the comments (when there are more comments than allowed on one page) links to the top of the page, so the user has to scroll down past the node body on every page.

Unfortunately, theme('pager') doesn't support an #fragment argument.

This patch changes the $parameters and $attributes for the theme_pager_XXX functions into an $options argument that is passed on to l() ($parameters is $options['query'] and $attributes is $options['attributes']), i.e. a more general solution. This also allows passing other options to l(), e.g. $options['html'] (e.g. if the pager links contain an <img> tag).

Additionally I made it possible to specify a different path than the current path, e.g. if the pager is inserted as a block on some other page that the main page. I don't know if this is a valid use case, but it way easy to do, so I guess the flexiblility may come out handy to someone.

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated 2 days ago

Created by

πŸ‡©πŸ‡°Denmark c960657

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024