custom menu function link advice

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.

Comments

  • acrylian Administrator, Developer
    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.
  • 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

    <;?php $firstimage = $_zp_current_album->getImages(); ?>
    " title="View album: <?php echo getAlbumTitle();?>"><?php printAlbumThumbImage(getAlbumTitle()); ?>

    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!
  • 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.
  • acrylian Administrator, Developer
    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.
  • 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
  • acrylian Administrator, Developer
    Sure, please look at our paid support page. The forum does not have any PM function.
Sign In or Register to comment.