Gallery Album Cover Images

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
LadyHLG
Forum Members
Forum Members
Posts: 38
Joined: Wed Apr 21, 2010 1:47 pm

Gallery Album Cover Images

Post by LadyHLG »

Is there a way to simply call the album cover for a specific gallery?

LadyHLG
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Gallery Album Cover Images

Post by Jos »

Not a simple one.. only via a UDT I guess
LadyHLG
Forum Members
Forum Members
Posts: 38
Joined: Wed Apr 21, 2010 1:47 pm

Re: Gallery Album Cover Images

Post by LadyHLG »

Darn! But thanks for the reply.
Can't really complain, its a great mod, I will see if I can come up with something but will also make a feature request, this would definitely make it easier to integrate with other mods (like blog) to link an album to a post and show the cover image in post summaries.

LadyHLG
gocreative
Power Poster
Power Poster
Posts: 265
Joined: Mon Mar 14, 2011 1:16 am
Location: Brisbane, Australia

Re: Gallery Album Cover Images

Post by gocreative »

Could you create a new gallery template and simply only output the album cover, then in your page template just reference that gallery template and ID?
LadyHLG
Forum Members
Forum Members
Posts: 38
Joined: Wed Apr 21, 2010 1:47 pm

Re: Gallery Album Cover Images

Post by LadyHLG »

Can I?
I can't seem to figure out how to only call the cover when I only have the album dir info.
I can call images by image number but that doesn't help as the cover could be different from album to album.
gocreative
Power Poster
Power Poster
Posts: 265
Joined: Mon Mar 14, 2011 1:16 am
Location: Brisbane, Australia

Re: Gallery Album Cover Images

Post by gocreative »

Untested, but this might work.

In your Gallery template (called "album_cover" in this example):

Code: Select all

{capture assign='album_cover'}
     {foreach from=$images item=image}
          {if $image->isdir}{$image->thumb}{/if}
     {/foreach}
{/capture}
Then call your gallery in your page template:

Code: Select all

{assign var='my_gallery_directory' value='your_gallery_path'}
{Gallery dir=$my_gallery_directory template='album_cover'}
My thought process is this:

1. Assign a variable which includes the gallery path.
2. Call the Gallery module and choose only that gallery.
3. The assigned Gallery template captures the "thumb" image path, saved as a variable {$album_cover} that you can re-use in your page template.

I'm not sure whether {$image->thumb} only outputs a single image, but it might give you some ideas at the very least.
LadyHLG
Forum Members
Forum Members
Posts: 38
Joined: Wed Apr 21, 2010 1:47 pm

Re: Gallery Album Cover Images

Post by LadyHLG »

Thank-you for the reply, unfortunately, this doesn't work :(

I think the problem is if you call it a specific gallery it pulls the information for the images and there doesn't appear to be anything in the $images array that indicates if an image is a cover image.

It will show the cover image if I loop through the list of galleries, but not if I pull the information for a specific gallery, the cover image link is part of the gallery info not the image info.

So if I have
MyGallery/SubGallery1
MyGallery/SubGallery2
etc.
And I want the cover image for SubGallery1.

If I call your template for MyGallery I will see all the cover images for each SubGallery but I don't need all those I only need the cover image for SubGallery1, but if I call SubGallery1, it loops through the images in that gallery but doesn't indicate which one is the cover image.
I hope that makes sense.

I think as indicated above I will have to do this with a UDT or hope that somewhere along the line the developer will add this as a feature.

All the same, thank-you, I really appreciate your help!

LadyHLG
Post Reply

Return to “Modules/Add-Ons”