Ticket #419 (closed Feature Request: fixed)

Opened 9 months ago

Last modified 9 months ago

Config option to hide pagination when only 1 page

Reported by: neovive Owned by: Geert
Priority: minor Milestone: 2.2
Component: Libraries Version: SVN HEAD
Keywords: pagination Cc:

Description

Right now, the pagination library displays '1' when there is only one page in the pagination resultset. In CI, when total_pages was 1, the pagination was no longer displayed. Perhaps, the create_links() method should first test if $this->total_pages > 1 before rendering the pagination links.

Another option would be to add a pagination config option to selectively enable the hiding of results if one page.

Change History

follow-up: ↓ 2   Changed 9 months ago by Geert

  • keywords pagination added
  • owner changed from - No owner - to Geert
  • status changed from new to assigned

It really depends on what pagination style you are using. Just "1" doesn't say must, but another style could display "Page 1 of 1". You may not want to hide that information.

I would say that in case you want to hide navigation when only one page is available, just edit your pagination style view. Wrap it in an if ($total_pages > 1) or don't load it in the first place.

On the other hand, adding an auto_hide setting (other name suggestions?) to the Pagination Library is done in no time.

in reply to: ↑ 1   Changed 9 months ago by neovive

A config option seems like a clean approach in case someone wants to display pagination for 1 page. Maybe "hide_one_page"?

  Changed 9 months ago by Geert

Alright, I'll implement it, probably tonight. Don't really like hide_one_page, hide_single_page would be better but is rather long. My preference still is auto_hide.

  Changed 9 months ago by Geert

  • status changed from assigned to closed
  • type changed from Patch to Feature Request
  • resolution set to fixed

Implemented in r2097.

  Changed 9 months ago by Shadowhand

  • milestone changed from 2.1.2 to 2.2
Note: See TracTickets for help on using tickets.