album.tpl

azarhya

Joined: 2008-08-26
Posts: 2
Posted: Tue, 2008-08-26 14:00

I'm probably reading "album.tpl" from gallery\themes\carbon\templates wrong because I'm not a coder but I am trying to understand. I get stuck after "{if ($childrenInColumnCount == $theme.params.columns)}". Is the code correct?

{if !count($theme.children)}
.
.
{else}
{assign var="childrenInColumnCount" value=0}
<div class="gsContentAlbum">
<table id="gsThumbMatrix" width="100%">
<tr valign="top">
{foreach from=$theme.children item=child}
{* Move to a new row *}
{if ($childrenInColumnCount == $theme.params.columns)}
</tr>
<tr valign="top">
{assign var="childrenInColumnCount" value=0}
{/if}
.
.
.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2008-08-26 15:50

{if ($childrenInColumnCount == $theme.params.columns)} is correct.
What is it you want to do?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
azarhya

Joined: 2008-08-26
Posts: 2
Posted: Wed, 2008-08-27 02:54

Thanks for your reply.
It is after the above mentioned line of code I do not understand. I'm simply just trying to learn by understanding the code. I can read and understand nearly all the album.tpl except for these lines:

</tr>
<tr valign="top">
{assign var="childrenInColumnCount" value=0}
{/if}

It is like something is missing or one of those lines is out of place or I am just readin it wrong.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-08-27 03:11

You have to have some knowlage of HTML to understand....

</tr>
<tr valign="top">
{assign var="childrenInColumnCount" value=0}
{/if}

means:
close the table row
start a new row
assign a varible $childInColumnCount to zero
close the {if....} from above

There is a theme setting on the theme tab of edit album where you set the number of columns ($theme.params.columns)
in the foreach that started at line 107 the if statement {if ($childrenInColumnCount == $theme.params.columns)}
the rows of the table are drawn. The if statement checks to see if the table has the right number of columns in the row before closing the row.

Hope that helps.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team