Modifying classic to show itemSummaries.newitems on subalbum list

davidwwatts

Joined: 2007-12-06
Posts: 35
Posted: Sun, 2008-02-17 16:12

Hi,

The classic theme displays subalbums which is really great. I'd like to add the NEW or UPDATED text next to each of those subalbums. I see that this text is from itemSummaries.newitems.

I was hoping this would do it:

{if isset($theme.treeItems[$node.id].itemSummaries.newitems)}
   <span class="summary-newitems summary">{$theme.treeItems[$node.id].itemSummaries.newitems}</span>
{/if}

However it doesn't work.

Looking into the code, I see that to produce the subalbum list, the classic theme calls GalleryCoreApi::fetchAlbumTree and builds a tree array and treeItems array. However, the treeItems array does not include the itemSummaries.newitems element, so the if always returns false.

Is there some other way to extract this element (I see it is in the children array)? Is there a way to display the NEW or UPDATED text next to the items in the subalbums list that have been updated or added?

Thanks.
David.