Answer the question
In order to leave comments, you need to log in
How to set up pagination in RSMediaGallery Joomla 2.5 NOT via Ajax?
Good afternoon. I am developing a site on Jooma 2.5 and using the RSMediaGallery gallery. Everything would be fine, but that's bad luck: pagination is implemented there through loading images on Ajax. Tell me how to replace it with a traditional one with pages like sitename.ru/gallery.html?page=2 , sitename.ru/gallery.html?page=3 , sitename.ru/gallery.html?page=4 , etc. Thanks in advance.
Answer the question
In order to leave comments, you need to log in
If anyone is interested. Working example empire-pools.ru/rsgall.html . Work should be done in this file components/com_rsmediagallery/views/rsmediagallery/tmpl/default.php
Script that adds a class to the .active
pagination page number
jQuery(document).ready(function($) {
var url=document.location.href;
$.each($(".rs-dl-pages li a"),function(){
if(this.href==url){$(this).addClass('selected');};
});
});
. Here is the pagination code$page_counter = ($this->total/$this->limit); // получаем количество страниц
$page_counter_round = round($page_counter, 0, PHP_ROUND_HALF_UP); // округляем значение
if($page_counter_round > 1) {
echo '<ul class = "rs-dl-pages">';
echo '<li><a href = "/rsgall.html" title = "">1</a>';
for ($page=2; $page<=$page_counter_round; $page++) {
echo '<li class = ""><a href = "/rsgall.html?start='.($page-1)*$this->limit.'" title = "">'.$page.'</a>';
// echo '<li><a href = "'.RSMediaGalleryRoute::_('index.php?option=com_rsmediagallery&view=rsmediagallery&limitstart='.($page-1)*$this->limit).'" title = "">'.$page.'</a>';
}
echo '</ul>';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question