D
D
Dmitry2017-02-03 22:29:41
Joomla
Dmitry, 2017-02-03 22:29:41

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

1 answer(s)
D
Dmitry, 2017-02-10
@DimaLepel

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 .activepagination 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 question

Ask a Question

731 491 924 answers to any question