Is there a way to make the search (search module) results page use the "mini" pager? The default appears to be "full" pager.

All other pagers on the site (mostly generated using Views) have the "mini" pager. I would prefer to use the search module for searches because it works a lot faster than searching via Views / exposed filters.

Accepted answer

Just to update that this issue has been fixed in 1.25. Please see https://github.com/backdrop/backdrop-issues/issues/6083

Comments

Hi @leeksoup

I think you can override the search results template.

Copy core/modules/search/templates/search-results.tpl.php to your theme and try to work out what to replace line 45 with.

It is currently:

  <?php print $pager; ?>

I guess there will be something in a views template that can give you the thing to replace it with.

 

Looks tricky actually. All the views mini pager is defined in classes. Not sure how to do this

Thanks for your thoughts. If I have any success, I'll post back.

Perhaps it could be done by CSS?

Probably a feature request is the best way to do this.

With CSS, I was thinking of hiding the bits you don't want and re-styling the bits you do want to match.

It would be complex, but as you have things like `pager-current` it may be possible.

You would probably also need something like:

`li:nth-last-child(1 of .pager-item)` to get the total number of `pager-item` items.

Interesting idea. Is that a css counter you're using? I'm not familiar with those but will look into it. Thanks.

I don't think that will work because the pager only generates a max of 9 numbered page items, so a counter won't return the actual number of pages in the search results.

I tried hiding (i.e. display: none) everything except .pager-current, .pager-previous and .pager-next and that more-or-less works. It's not exactly the same as the Views mini pager, but I think it's better than the default pager.

E.g.

Thanks for your suggestions to try this!

I forgot about the limit of 9.

Looks good what you've managed to do though.

Let's hope your feature request gets some traction. While too late for the next release, you could add yourself as an advocate for it which raises its profile and may get it into 1.26.