ZenphotoCMS Forum
Returning to page 'n' of gallery page - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Returning to page 'n' of gallery page (/thread-11832.html)



Returning to page 'n' of gallery page - ayutheos - 2014-06-15

I posted the same question previously (http://www.zenphoto.org/support/topic.php?id=221), but that was quite some time ago so am re-asking this for the current version of zenphoto.

Have just upgraded to 1.4.6 from 1.4.5.9, and noticed that the gallery link returns to the 1st page instead of the page that I'm currently on (e.g. previously if I'm on page 5 of my gallery page, clicking on link would return me to page 5). Makes browsing the gallery site a bit tedious.

Is this changed in the newer version or is there a theme function for this?




Returning to page 'n' of gallery page - acrylian - 2014-06-15

Do you mean you selected an album on gallery page 5 and then want to return from that album to page 5?

You would have to pass the value of the current gallery page to whereever you are clicking so you can return to it. Since all are links and no form elements you can only append that via a GET query to the url and check that on the target page. Something like &returnpage=. Then append it to the gallery url.

The current page number is stored in the global variable $_zp_page (for all standard theme paginations gallery, album, news articlces).




Returning to page 'n' of gallery page - ayutheos - 2014-06-15

Yes. What do I put in my theme file to do that? I was using `




Returning to page 'n' of gallery page - acrylian - 2014-06-15

Actually I don't remember any changes in 1.4.6 (but I might not have been involved) and actually not even that this ever worked…

YOu would have to pass the page you are on to the page you are going.
Then you have to check for the page and append a query to the return url. getCustomPageURL() has a parameter for queries.

EDIT: Indeed I still have a 1.4.5.9 install locally and there it works. Have to look what changed. But it should only have worked with getGalleryIndexURL(). Indeed a lot has been removed here.




Returning to page 'n' of gallery page - ayutheos - 2014-06-15

How do I do that? I referred to the template function documentation but am not sure how to do it. I'm not familiar with php




Returning to page 'n' of gallery page - acrylian - 2014-06-15

Well, as of the current state you will not be able to do it if you are not at least a bit familiar with php. I look at it and try to get the old functionality back. I didn't notice that my former colleague had remove it all. Could have been an accident or a reason I don't understand yet as the function was deprecated a short time until it was redecided.




Returning to page 'n' of gallery page - ayutheos - 2014-06-15

Sorry, posted before seeing your edited comment above..

re: getCustomPageURL, how do I pass the current page I'm on to getCustomPageURL?




Returning to page 'n' of gallery page - acrylian - 2014-06-15

Not that easy, you have to edit every album link to include the current page number. Then you ahve to read that and pass it back. Use the parameter and append a query (&page= or modwrite /page/.

Give me some time to get the functionality back.




Returning to page 'n' of gallery page - ayutheos - 2014-06-15

Ok, thanks for looking into this.




Returning to page 'n' of gallery page - acrylian - 2014-06-15

I opened a ticket for further discussion: https://github.com/zenphoto/zenphoto/issues/831