Hide Date field for Albums, show date for Images (theme - Matrix) "showDate" edit

jasher

Joined: 2007-12-10
Posts: 2
Posted: Sat, 2007-12-15 16:36

I had this request from a client, and maybe it'll help other developers implement this request in their galleries. The client wanted to show dates for images, but not for albums. So I'm offering this solution for others.

This was done on a copy of Matrix, and it's done in album.tpl in the templates/local folder of your theme. I worked this out by studying the code to "showOwner", just above the the code I needed to edit.

Original code starting around line 153 with date turned off:

Quote:
{if ($child.canContainChildren && $theme.params.showAlbumOwner) ||
(!$child.canContainChildren && $theme.params.showImageOwner)}
{assign var="showOwner" value=true}
{else}
{assign var="showOwner" value=false}
{/if}
{g->block type="core.ItemInfo"
item=$child
showDate=false
showOwner=$showOwner
showSize=false
showViewCount=false
showSummaries=false
class="giInfo"}

Edited code with date on for images, off for albums:

Quote:
{if ($child.canContainChildren && $theme.params.showAlbumOwner) ||
(!$child.canContainChildren && $theme.params.showImageOwner)}
{assign var="showOwner" value=true}
{else}
{assign var="showOwner" value=false}
{/if}
{if ($child.canContainChildren) }
{assign var="showDate" value=false}
{else}
{assign var="showDate" value=true}
{/if}

{g->block type="core.ItemInfo"
item=$child
showOwner=$showOwner
showDate=$showDate
showSize=false
showViewCount=false
showSummaries=false
class="giInfo"}

Hope that speeds up your customization.

 
nehoral

Joined: 2008-02-05
Posts: 1
Posted: Sun, 2008-09-28 16:18

Yes, it helps. Thank you very much.