Skip to main content

Dynamically Disabling Pagination

More
15 years 9 months ago - 15 years 9 months ago #3045 by brainforge
I wanted to remove the pagination elements when there are only a few products displayed.
The way I have done this for now is:

Change template code from:
Code:
if($this->params->get('show_limit') && $this->pageInfo->elements->total){
to:
Code:
if($this->params->get('show_limit') && $this->pageInfo->elements->total > 5){

Is there a better way?
Last edit: 15 years 9 months ago by nicolas. Reason: removing the php tags from the code to avoid displaying issues

Please Log in or Create an account to join the conversation.

More
15 years 9 months ago #3047 by nicolas
It's perfect like this :)

Please Log in or Create an account to join the conversation.

More
15 years 9 months ago #3289 by brainforge
Not quite working as I hoped.
It seems to remember limit->value, so I got into the situation where it would only display, say, 1 product out of 3 with no pagination shown. Workedaround with:
Code:
if($this->params->get('show_limit') && $this->pageInfo->elements->total > $this->pageInfo->limit->value && $this->pageInfo->limit->value)

Please Log in or Create an account to join the conversation.

Time to create page: 0.184 seconds
Powered by Kunena Forum