Accessing Album Fields within Template Code

zaripu

Joined: 2004-05-27
Posts: 14
Posted: Wed, 2005-07-13 13:16

In my never-ending search for perfection I'm trying to set things up so that the date and time are displayed for every album in "layout" view, except the ones at the second level (I was going to say top level but I think there's only one album at the top level - the all-encompassing gallery-wide album). There's a way to check whether an item is album or a picture by checking whether it can contain other items, using the following type of code:

{if ($it.canContainChildren)}
...
{else}
...

Is there a similar way to check whether an album is at a particular level in the gallery structure? I was thinking of using either the keyword or the custom field feature but I can't find any documentation on how to check the contents of these fields. For instance, there's a way to check whether the summary field is filled up by using the following code:

{if isset($it.summary)}
...
{/if}

Where can I find documentation on how to access the other fields in an album?

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Tue, 2005-08-09 23:18

I also would like to know how to get the custom field values from within a template. Thanks.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-08-10 00:34

see G2 customization guide, sticky topic in this forum for some basic info.
turn on debug output in config.php and reload.. you'll get a popup (if not blocked) showing all the data available to the template.
try putting
{g->callback type="customfield.LoadCustomFields" itemId=$theme.item.id}
in your template and see what new data becomes available.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Wed, 2005-08-10 01:04

Thanks, that info combined with looking at the smarty cache was what I needed.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Wed, 2005-08-10 15:53

I'm now trying to get the default album thumbnail size. I can't find a callback to retreive this information. It looks like ItemEditItem.inc gets this information by calling getDerivativeOperations. But I don't know how to call that function on the objects while inside a template. Any help would be appreciated. Thanks.