Page 1 of 1

Modding the Allbum template help

Posted: Wed Jul 16, 2008 8:58 pm
by rhamej
Hi guys. I'm having a little trouble modding the default template for the Album module. First, I am a code hacker, so I may not be going about this the correct way. So sorry if I come across like an idiot.

Here is what I am trying to do.
I only need the first image to be displayed in an album. Which I have done so far by changing the default.tpl to this

Code: Select all

{assign var=picCounter value=0}
{if $pictureid !=0}
{* Big Picture *}
<div style="text-align:center">
<p class="bigpicturecaption"><strong>{$picture->name}</strong><br />
{$picture->comment}<br />
<span class="bigpicturenav">
{if $link.picture.previous}<a href="{$link.picture.previous}" title="Previous picture">< Previous</a>{/if}
 <span class= "albumpicturecount">( Picture {$picturenumber}/{$picturecount} )</span> 
{if $link.picture.next}<a href="{$link.picture.next}" title="Next picture">Next ></a></span>{/if}
</p>
<img src="{$picture->picture}" alt="{$picture->name|escape:'html'}  title="{$picture->name|escape:'html'}  />
</div>
{/if}
{* End Big Picture *}

{* Display Album*}
<div class="image_block">
{foreach from=$pictures item=picturesrow}
{foreach from=$picturesrow item=onepicture}
{if $picCounter==0}{assign var=picCounter value=1}
     <div>
     <a href="{$onepicture->picture}" rel="lyteshow[{$album->name|escape:'html'}]">
     <img src="{$onepicture->thumbnail}"  {$onepicture->autothumbnailsize} /></a>
     </div>
    
     <div class="info">
     <h3>{$album->name}</h3>
     {$album->comment}
    </div>

      {else}
      <div style="display:none;" ><a href="{$onepicture->picture}" rel="lyteshow[{$album->name|escape:'html'}]" > </a>
   	   </div>
       {/if}
      
{if ($onepicture->number==$picturenumber and !$picture)}{assign var=picture value=$onepicture}{/if}
	{/foreach}
	{/foreach}
</div>
This way you can click on the image and click though the lyteshow slide show.
Now I can display the ablums like so

Code: Select all

{cms_module module='album' albums='1'} {cms_module module='album' albums='3'}
However, i would like to make the backend easier for the client to update.
I would like to be able to assign an album to a category and hard code the tag into the template. That way the client only has to modify the albums.

I have tried to use

Code: Select all

{cms_module module='album' categories='3'}
But nothing shows up.

Sorry if I am going about this the wrong way, but like I said, I am code hack.  :(

Thanks,
Josh

Re: Modding the Allbum template help

Posted: Thu Jul 17, 2008 10:37 am
by Dr.CSS
If you just want them to use your template as the default when making Albums go to the Options tab and in the Default Template: drop down choose your template and Save and they will always be using it...

Re: Modding the Allbum template help

Posted: Thu Jul 17, 2008 12:12 pm
by rhamej
Hi Mark,

Thanks for the reply.
Using the template as the default one is not the problem. The problem is when I want to assign an album to a category, then try to display just the category by using

Code: Select all

{cms_module module='album' categories='3'}
Nothing is shown.

I understand that when using categories, it uses the categories.tpl first, then what ever template is assigned to the album.
I'm just trying to make it so that I can hard code the tags into the html template instead of having the client update the content field with

Code: Select all

{cms_module module='album' albums='1'} {cms_module module='album' albums='3'}
every time there is a new album. There will be over 100 albums  :-\

Make since?

Thanks,
Josh

Re: Modding the Allbum template help

Posted: Thu Jul 17, 2008 7:52 pm
by Dr.CSS
You do have a third category in Album?...

Re: Modding the Allbum template help

Posted: Fri Jul 18, 2008 3:48 pm
by rhamej
mark wrote: You do have a third category in Album?...
Yepper  :)

Re: Modding the Allbum template help

Posted: Thu Jul 31, 2008 5:55 pm
by rhamej
bump :)