Page x of y, Picture x of y

dj-3plet

Joined: 2005-03-12
Posts: 70
Posted: Sat, 2005-08-27 14:40

i have a custom navigator that shows "Page x of y" and "Picture x of y" between the previous and next links. i upgraded my dev site to rc2. now the "Page x of y" still works, but the "Picture x of y" does not work.

here's the code i'm using:

    {strip}
      &
      {if isset($theme.currentPage)}
	{g->text text="Page %d of %d" arg1=$theme.currentPage arg2=$theme.totalPages}
      {else}
	{if isset($theme.peerCount)}
	{g->text text="Picture %d of %d" arg1=$theme.peers[$theme.peerItemIndex].peerIndex arg2=$theme.peerCount}
	{/if}
      {/if}
      &
    {/strip}

any ideas?

my dev site: http://dev.pinneo-triplets.com/gallery2

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-08-27 17:02

peer data is now a callback, not loaded by loadCommonTemplateData.
see core/templates/blocks/PeerList.tpl and
http://codex.gallery2.org/index.php/Gallery2:Tpl_Reference

 
dj-3plet

Joined: 2005-03-12
Posts: 70
Posted: Sat, 2005-08-27 21:39

ok, i'm kind of thick. could you give me a (further) nudge in the right direction?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-08-27 22:32

doesn't the top of PeerList.tpl show how to load the data?
put that callback into your tpl.. the tpl reference tells you what data becomes available after calling the callback.