Question to Album - accessing entities

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
micfritschi
Forum Members
Forum Members
Posts: 26
Joined: Wed Nov 29, 2006 9:56 am

Question to Album - accessing entities

Post by micfritschi »

Hello,

I know, the Album-Modul isn't supported anymore. My question is more about how to access entities (?) in the templates.

Example:
I'd like to show all thumbnails from all album-galleries, so I tried something like this (with the separate_thumbnails-template):

Code: Select all

{if !$album}
{if $returnlink}<br /><a href="{$returnlink}">Back</a>{/if}
<table>
	{foreach from=$albums item=album}
	<tr style="height:100px;vertical-align:middle">
		<td style="border:1px solid #ECECEC;width:100px;text-align:center">
			<a href="{$album->link}"><img src="{$album->thumbnail}" alt="{$album->name|escape:'html'}" /></a>
		</td>
		<td style="border:none;width:500px;text-align:left">
			{$album->name} <em>({$album->picturecount} images)</em><br />
			{$album->comment}

	{foreach from=$album item=pictures}
	<table>
		{foreach from=$pictures item=picturesrow}
		<tr style="height:100px;vertical-align:middle">
			{foreach from=$picturesrow item=onepicture}
			<td style="border:1px solid #ECECEC;width:100px;text-align:center">
				<a href="{$onepicture->link}"> <img src="{$onepicture->thumbnail}" alt="{$onepicture->thumbnail}" /> </a>
			</td>
			{if ($onepicture->number==$picturenumber and !$picture)}{assign var=picture value=$onepicture}{/if}
			{/foreach}
		</tr>
		{/foreach}
	</table>
	{/foreach}
</table>
...
My problem is that I can't access the pictures. What am I missing? Isn't this possible?

Thank you for any hints/help!
michael
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Question to Album - accessing entities

Post by Dr.CSS »

If you are trying to show a single thumbnail of each album linking to each full album then just use the {cms_module module='album'} tag and it will default to show one thumb from each album as a link that goes to the full album...
micfritschi
Forum Members
Forum Members
Posts: 26
Joined: Wed Nov 29, 2006 9:56 am

Re: Question to Album - accessing entities

Post by micfritschi »

no, that isn't what I'm looking for (this already works fine).

In an overview, I'd like to show the thumbnails of all images per album:

album 1: thumb 1 - thumb 2 - thumb 3
album 2: thumb 1 - thumb 2 - thumb 3 - thumb 4
album 3: thumb 1 - thumb 2
etc...

I thought that in the album-loop the cms 'knows' what album is active and can easily get the thumbs of the images contained in the album. But somehow it's not working...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Question to Album - accessing entities

Post by Dr.CSS »

The only way to get an Album to show all the thumbs on first look/page is to call the album itself, {cms_module module='album' albums='2'} 2 being the ID of the album, that will show all the thumbs of that album and not the single album thumb, so you would need to call all of them like that...
micfritschi
Forum Members
Forum Members
Posts: 26
Joined: Wed Nov 29, 2006 9:56 am

Re: Question to Album - accessing entities

Post by micfritschi »

thank you, that's great!

the only thing is, when clicking on a thumbnail, I still have the overview of the non-selected album (because the template is called twice). I tried to specify an other page with the param
detailpage='showalbum'
but without any success - nothing will be shown there.

Do I specify something else for the second page?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Question to Album - accessing entities

Post by Dr.CSS »

Album doesn't have a detail page parameter, sorry, you may want to give each album it's own page...
micfritschi
Forum Members
Forum Members
Posts: 26
Joined: Wed Nov 29, 2006 9:56 am

Re: Question to Album - accessing entities

Post by micfritschi »

ok, just thought that it was mentionned in the module description.

Finally got a solution (at least a half-one):
in class.Album.php, function GetAlbums I added:

$album->pictures = $this->GetPictures($row['album_id']);

In the separate_thumbnails template it goes like this:

Code: Select all

		<td style="border:none;width:500px;text-align:left">
			{$album->name} <em>({$album->picturecount} images)</em><br />
			{$album->comment}<br />
			{foreach from=$album->pictures item=picture}
				<a href="index.php?mact=Album,mec8c1,default,1&mec8c1albumid={$album->id}&mec8c1pictureid={$picture->id}&mec8c1returnid=56&page=56"><img src="{$picture->thumbnail}" alt="{$picture->thumbnail}" /></a>
			{/foreach}
		</td>
The only thing that isn't pretty now is the url - i can't get it otherwise.
.. Help would be very appreciated.

Regards,
michael

by the way: it's a pitty album is not continued anymore. I like its simplicity and clearness
Post Reply

Return to “Modules/Add-Ons”