ZenphotoCMS Forum
get current page url - 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: get current page url (/thread-12392.html)



get current page url - RB26 - 2015-12-22

bonjour
could you tell me how get the current page url (zenpage, news, album, image)?
I didn't found the function
merci




get current page url - RB26 - 2015-12-22

I've found: getRequestURI()
it is what I searched




get current page url - acrylian - 2015-12-22

Actually I think it would be better to use the object model, unless you want to do something specific. There are global variables available for all five main items (album, image, Zenpage page, news article and news category) that contain the object of the current item if in context:
$_zp_current_image, $_zp_current_album, $_zp_current_zenpage_page, $_zp_current_zenpage_news, $_zp_current_category
On an single image page both the album and image one are available naturally.

The object method getLink() will five you the url on all. Within functions you of course need to declare that global to be able to use it.

There are more such globals: http://www.zenphoto.org/news/zenphotos-global-variables