ZenphotoCMS Forum
custom menu function link advice - 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: custom menu function link advice (/thread-10986.html)



custom menu function link advice - lainyrache - 2013-04-10

Hi I want to create a link from the custom menu to an album view which contains the first default large image with album thumbnails on the right.
I have this sorted out on my image.php page but don't know how to link to it dynamically from the custom menu.
I have successfully hardcoded via the custom link mydomain/albumname/imagename.jpg.php
but this breaks eventually when using tags links. (The last tags list is remembered instead of 'all' )
I hope this makes some sense to someone, any advice much appreciated.




custom menu function link advice - acrylian - 2013-04-10

Sorry, there is no convenient way to dynamically link to the first image directly using the menu.

The only way would be to use the print_album_menu menu function within the custom menu.




custom menu function link advice - lainyrache - 2013-04-11

Thanks acrylian,
As far as I can see there isn't a way to use the print_album_menu function to link to only one album excluding all others, is that right?
Our menu is linking to a combination of pages, a news category and a customlink to the first image of one of the ablums.

This works well until a tag is clicked and then the user sort of gets trapped in the thumbs for that tag.
The only way out is to click on another page and then the menu link, to see all the images in that album.

As a work around, I tried to create a back to Gallery link on image.php using the code from another post http://www.zenphoto.org/support/topic.php?id=3472

getImages(); ?>
" title="View album: ">

But this has the same issue, as it is looking for the images in the current album.
I tried adapting this to go to the first image of the album 'MyAlbumName', but I just can't find the right code.
Can anybody help?
Thanks for any pointers!




custom menu function link advice - lainyrache - 2013-04-11

Am I getting there?

I have gone to admin> menus
Then selected type function and in function field i need to add the function to select album > first image

So something like
getFirstImageOfAlbum( $_zp_albums=>'mygallery' )

Embarrassing attempt I know. Please don't laugh.




custom menu function link advice - acrylian - 2013-04-11

No, right way atually. You have to create a function that lets you do this.

You will need to create the object of the album in question and then use $imageobj = $albumobj->getImage(0) which gets the first image as sorted as an image object. Then you can use $imageobj->getImageLink().

Btw, you could open a ticket for an option to allow this in the menu on the GitHub tracker. So we might consider it for the 1.4.5 release.




custom menu function link advice - lainyrache - 2013-04-11

Hi Acrylian
Thank you again, but lots of headscratching and still this is way beyond me. I am soooooooo stuck. Can you do this for a fee /donation. If so can you PM me?
or anyone else?
thanks




custom menu function link advice - acrylian - 2013-04-11

Sure, please look at our paid support page. The forum does not have any PM function.