Matrix Jump Pager - How do I show all pages?

Dozza
Dozza's picture

Joined: 2007-08-28
Posts: 112
Posted: Mon, 2011-03-07 15:36

Im using G2 at http://www.milliepilkington.co.uk

I'd like the Page Jumper navigation at the bottom of Album pages (example http://www.milliepilkington.com/v/children/?g2_page=3) to show all the page numbers, rather than showing a link to first 6 then ....

How do I change the default 6 figure to something higher, or how do I simply have G2 show ALL the page numbers. There will probably never be more than 15 at most.

I've found a post (http://gallery.menalto.com/node/37179) that seems to be covering what I'm after but doesn't explain too well exactly which lines of code to add/change.

Appreciate any help.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2011-03-09 00:03

I don't have much time or enthusiasm for G2 right now but see if adding:

            <div id="gsPages{$position}">
              {g->text text="<font class='giInfo'>Page:</font>"}
              {assign var="lastPage" value=0}
              {foreach name=jumpRange from=$theme.jumpRange item=page}
                  {if ($page - $lastPage >= 2)}
	          <span>
                    {if ($page - $lastPage == 2)}
                      <a href="{g->url params=$theme.pageUrl arg1="page=`$page-1`"}">{$page-1}</a>
                        {$page-1}
                      </a>
                    {else}
                      ...
                    {/if}
	          </span>
                {/if}
	        <span>&nbsp;
                  {if ($theme.currentPage == $page)}
                    <font class='giInfo'>
                      {$page}
                    </font>
                  {else} 
                    <a href="{g->url params=$theme.pageUrl arg1="page=$page"}">
                      {$page}
                    </a>
                  {/if}
	        </span>
                {assign var="lastPage" value=$page}
              {/foreach}
            </div>

to the album.tpl of the theme you are using does the trick.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Dozza
Dozza's picture

Joined: 2007-08-28
Posts: 112
Posted: Fri, 2011-03-11 17:36

Thanks for trying Floridave

Unfortunately, that just repeats the pager in exactly the same format and doesn't show all pages still.

Sorry you've fallen out of love with G2. I'd like to move up to G3 but would have to rework the theme from scratch so I read.

Where is the 'show the first 6 page numbers hard coded?

Dozza

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2011-03-11 19:30

The webmaster of this page http://andrewprokos.com/photos/architecture/ has figured it out.
He is using the pgTheme ( I don't kow if that is the default setting or not ) http://andrewprokos.com/gallery2/themes/PGlightbox/theme.inc
Wright to him and see if he can help you out.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-03-12 08:25

The matrix theme does not set the jump range and so picks up the G2 default of 6.

You can fix this by editing the standard settings in your theme.inc.

Change...

	$this->setStandardSettings(
	    array('rows' => 3, 'columns' => 3,

to

	$this->setStandardSettings(
	    array('rows' => 3, 'columns' => 3, 'pageWindowSize'=> 16,

This will give a 16 page jump range which should be enough for you since you said the max is 15

--
dakanji.com

 
Dozza
Dozza's picture

Joined: 2007-08-28
Posts: 112
Posted: Mon, 2011-03-14 10:05

Thanks for the tip off Floridave- i've PM'd him.

 
Dozza
Dozza's picture

Joined: 2007-08-28
Posts: 112
Posted: Mon, 2011-03-14 10:08

Dayo

I've implemented into theme/matrix/local/them.inc but it has no effect, even after flushing templates.

Can I not simply change the G2 default of 6 in a file/config setting somewhere?

Dozza

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-03-14 13:52

GalleryTheme.class
$windowSize = isset($params['pageWindowSize']) ? $params['pageWindowSize'] : 6;
but as Dayo said his settings should have worked.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-03-14 14:20
Dozza wrote:
Dayo

I've implemented into theme/matrix/local/them.inc but it has no effect, even after flushing templates.

Can I not simply change the G2 default of 6 in a file/config setting somewhere?

Dozza

You can change the G2 default as per Dave's post but you should really be changing it at the theme level and my suggestion should have done it ... at least in G2.3.1 as I notice you have an older version.

An alternative way is to undo the previously suggested change and change ....

function showAlbumPage(&$template, $item, $params, $childIds) {

to

function showAlbumPage(&$template, $item, $params, $childIds) {
$params = array_merge(array('pageWindowSize' => 16), $params);

Better still, upgrade to G2.3.1 and the previously given code would work.

--
dakanji.com