Re : Personnalisez la pagination de joomla ?
Regardes sur mon site, ça utilise la surcharge, pas dans ton look, mais ça marche...
Regardes sur mon site, ça utilise la surcharge, pas dans ton look, mais ça marche...
function pagination_list_render($list)
{
// Initialize variables
$html = null;
// Reverse output rendering for right-to-left display
$html .= $list['start']['data'];
$html .= $list['previous']['data'];
foreach( $list['pages'] as $page ) {
$html .= ' '.$page['data'];
}
$html .= ' '. $list['next']['data'];
$html .= ' '. $list['end']['data'];
return $html;
}
<?php
/**
* @version $Id: pagination.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct accessdefined('_JEXEC') or die('Restricted access');
/**
* This is a file to add template specific chrome to pagination rendering.
*
* pagination_list_footer
* Input variable $list is an array with offsets:
* $list[limit] : int
* $list[limitstart] : int
* $list[total] : int
* $list[limitfield] : string
* $list[pagescounter] : string
* $list[pageslinks] : string
*
* pagination_list_render
* Input variable $list is an array with offsets:
* $list[all]
* [data] : string
* [active] : boolean
* $list[start]
* [data] : string
* [active] : boolean
* $list[previous]
* [data] : string
* [active] : boolean
* $list[next]
* [data] : string
* [active] : boolean
* $list[end]
* [data] : string
* [active] : boolean
* $list[pages]
* [{PAGE}][data] : string
* [{PAGE}][active] : boolean
*
* pagination_item_active
* Input variable $item is an object with fields:
* $item->base : integer
* $item->link : string
* $item->text : string
*
* pagination_item_inactive
* Input variable $item is an object with fields:
* $item->base : integer
* $item->link : string
* $item->text : string
*
* This gives template designers ultimate control over how pagination is rendered.
*
* NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both
*/
function pagination_list_footer($list)
{
$html = "<div class=\"list-footer\">\n";
$html .= "\n<div class=\"limit\">".JText::_('Display Num').$list['limitfield']."</div>";
$html .= $list['pageslinks'];
$html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";
$html .= "\n<input type=\"hidden\" name=\"limitstart\" value=\"".$list['limitstart']."\" />";
$html .= "\n</div>";
return $html;
}
function pagination_list_render($list)
{
// Initialize variables $html = null;
// Reverse output rendering for right-to-left display
$html .= '<< ';
$html .= $list['start']['data'];
$html .= ' < ';
$html .= $list['previous']['data'];
foreach( $list['pages'] as $page ) {
$html .= ' '.$page['data'];
}
$html .= ' '. $list['next']['data'];
$html .= ' >';
$html .= ' '. $list['end']['data'];
$html .= ' >>';
return $html;
}
function pagination_item_active(&$item)
{
return "<a class=\"pagenav\" href=\"".$item->link."\" title=\"".$item->text."\">".$item->text."</a>";
}
function pagination_item_inactive(&$item)
{
return "<span class=\"pagenav\">".$item->text."</span>";
}
?>
/* Page navigation*/ ul.pagenav, div.pagination { width:100%; display:block; text-align:center; } ul.pagenav li, div.pagination ul li { display:block; float:left; background:none; padding:0; margin:0 5px 0 0; } ul.pagenav li a, div.pagination ul li a, a.pagenav, .pagenav_prev a, .pagenav_next a, .pagenavbar a, .back_button a { height:21px; text-transform:uppercase; font-weight:normal; line-height:21px; padding:0 5px; } /* Surcharge dans custom.css */ a.pagenav, .pagenav_prev a, .pagenav_next a, .pagenavbar a, .back_button a { background:#c8c8c8; border:1px solid #727272; color:#121212; } pagenavbar a:hover { color:#727272; }
function pagination_list_render($list)
{
// Initialize variables $html = null;
// Reverse output rendering for right-to-left display
$html = '<p class="page-link">';
$html .= '<span id="before">';
$html .= $list['start']['data'];
$html .= $list['previous']['data'];
$html .='</span><span id="numero">';
foreach($list['pages'] as $page ) {
$html .= ' '.$page['data'];
}
$html .='</span><span id="after">';
$html .= ' '. $list['next']['data'];
$html .= ' '. $list['end']['data'];
$html .= '</span>';
$html .= '</p>';
return $html;
}
Commentaire