Memorial Day
Support will be closed on Monday, May 28th, 2012 to enjoy Memorial Day with our friends and families.
   
 
Pagination - add top/bottom conditional
Posted: 25 October 2011 05:14 AM   [ Ignore ]  
Grad Student
Rank
Total Posts:  55
Joined  12-17-2009

Hi,

Thanks for the latest changes on the channel entries paginate tag, great improvement.

For some clients i need to have a pagination where the top pagination layout is somewhat different from the bottom pagination layout.

Currently i made a small hack to the “add_pagination_data” function in the channel module:

switch ($position)
   
{
    
case "top" $this->return_data  $this->EE->functions->prep_conditionals($this->paginate_data, array('top' => true'bottom' => false)) .$this->return_data;
     break;
    case 
"both" $this->return_data  $this->EE->functions->prep_conditionals($this->paginate_data, array('top' => true'bottom' => false)).$this->return_data.$this->EE->functions->prep_conditionals($this->paginate_data, array('bottom' => true'top' => false));
     break;
    default  : 
$this->return_data .= $this->EE->functions->prep_conditionals($this->paginate_data, array('top' => true'bottom' => true));
     break;
   

With this hack i can do this:

{paginate}
  {if top}
   add this this line
  {
/if}
  {current_page} of {total_pages}
  {if bottom}
    also add this line
  {
/if}
{
/paginate} 

Is it possible to include this functionality or to add an extra hook for add_pagination_data ?

Thanks in advance.

Profile
 
 
Posted: 01 December 2011 11:08 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  86
Joined  12-13-2007

I second this!

Profile
 
 
Posted: 03 January 2012 01:42 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  9
Joined  12-08-2011

+1

Profile
 
 
Posted: 05 January 2012 07:16 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  80
Joined  04-08-2010

Was just looking for a way to do this. Thanks for the hack smile

+1 on implementing this into future versions

Profile
 
 
Posted: 12 February 2012 09:25 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Avatar
Rank
Total Posts:  80
Joined  04-08-2010

Looks like the “add_pagination_data” function was removed from the channels module in version 2.4

Any thoughts on how to fix this?

Profile