The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Aug 11, 2011 10:23 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jul 06, 2011 8:06 am
Posts: 7
Hi,
I am developing an image gallery component.I want to change the default layout of the pagination links in the front end.When i searched about this,the way to do that is, changing the pagination.php in the template/html directory. But when installing the component i think editing the template pagination file is not possible.Is there any other way to achieve this???like editing the css or anything..
How we can override the template pagination layout inside a component?
If anyone know please help me..I am new to joomla..


Top
 Profile  
 
PostPosted: Sun Aug 14, 2011 5:40 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Sat Oct 28, 2006 11:16 pm
Posts: 1051
Location: Texas
I'm in the same boat. This was easy in 1.6 - as you described changing the template/html/pagination.php was all you needed to do.

_________________
Honk if this signature offends you.


Top
 Profile  
 
PostPosted: Sun Aug 14, 2011 7:59 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Sat Oct 28, 2006 11:16 pm
Posts: 1051
Location: Texas
Looking through libraries/joomla/html/ I found pagination.php

In this file, around line 277 I found this:
Code:
$chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';


That indicates that the override capability is still present, but maybe that it's changed since 1.6.

_________________
Honk if this signature offends you.


Top
 Profile  
 
PostPosted: Wed Nov 02, 2011 5:32 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Jun 29, 2009 1:59 am
Posts: 29
I would be interested in knowing how to override the default layout for the pagination in 1.7 without changing the core.

I tried copying the pagination.php from Beez template in 1.5 and placed it in the HTML folder in my template 1.7, but the override doesn't take in effect.

Not sure why.


Top
 Profile  
 
PostPosted: Fri Jan 20, 2012 7:59 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Fri Jul 14, 2006 5:13 pm
Posts: 3
Changing this at the bottom of the template pagination.php page in the template allowed me to custom the start and end.

Code:
function pagination_item_active(&$item) {
   
   return "<li>&nbsp;<strong><a href=\"".$item->link."\" title=\"".$item->text."\">".$item->text."</a></strong>&nbsp;</li>";
}

function pagination_item_inactive(&$item) {
   if (is_int($item->text)) {
      return "<li class=\"current\"'>&nbsp;<span>".$item->text."</span>&nbsp;</li>";
   } else {
      return "<li class=\"disabled\"'>&nbsp;<span>".$item->text."</span>&nbsp;</li>";
   }
}


This is the full pagination.php page. It goes into templates/yourtemplate/html


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: Wed Jul 18, 2012 5:49 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Mar 11, 2011 7:08 pm
Posts: 10
Ok, I thought I got this, but obviously not...

Should the following code not leave me with only the Next and previous buttons in the pagination? I created a root/templates/TEMPLATE/html/pagination.php with the following content..

Code:
<?php
   /**
    * Create the html for a list footer
    *
    * @param   array  $list  Pagination list data structure.
    *
    * @return  string  HTML for a list start, previous, next,end
    *
    * @since   11.1
    */
    function _list_render($list)
   {
      // Reverse output rendering for right-to-left display.
      $html = '<ul>';
      //$html .= '<li class="pagination-start">' . $list['start']['data'] . '</li>';
      $html .= '<li class="pagination-prev">' . $list['previous']['data'] . '</li>';
/*
      foreach ($list['pages'] as $page)
      {
         $html .= '<li>' . $page['data'] . '</li>';
      }
*/
      $html .= '<li class="pagination-next">' . $list['next']['data'] . '</li>';
      //$html .= '<li class="pagination-end">' . $list['end']['data'] . '</li>';
      $html .= '</ul>';

      return $html;
   }
?>



But it does nothing. Please explain, it driving me nuts.

Thank you


Top
 Profile  
 
PostPosted: Wed Jul 25, 2012 2:59 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Mar 11, 2011 7:08 pm
Posts: 10
Found out the solution to this....


Code:
<?php
   /**
    * Create the html for a list footer
    *
    * @param   array  $list  Pagination list data structure.
    *
    * @return  string  HTML for a list start, previous, next,end
    *
    * @since   11.1
    */
    function pagination_list_render($list)
   {
      // Reverse output rendering for right-to-left display.
      $html = '<ul>';
      //$html .= '<li class="pagination-start">' . $list['start']['data'] . '</li>';
      $html .= '<li class="pagination-prev">' . $list['previous']['data'] . '</li>';
/*
      foreach ($list['pages'] as $page)
      {
         $html .= '<li>' . $page['data'] . '</li>';
      }
*/
      $html .= '<li class="pagination-next">' . $list['next']['data'] . '</li>';
      //$html .= '<li class="pagination-end">' . $list['end']['data'] . '</li>';
      $html .= '</ul>';

      return $html;
   }
?>



Just needed to add "pagination" to the function name !

thanks very much to this article... http://demente-design.com/extensions/it ... n-override


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 



Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group