Smartytag Help for album title

nlao
nlao's picture

Joined: 2005-08-06
Posts: 18
Posted: Fri, 2009-08-21 13:32

I have a site structure which is this

galleryroot --> albums --> photos etc

However the way I interface with the gallery is to not use the root but jump into the albums bit. Each album is called something different.

I would like to know if there is a smartytag code for the "album you are currently in" so that I can use it as the page title. Currently I use this {$theme.item.title|markup} but that gives the title of the current object.

Thanks for your time!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2009-08-21 13:42

If you put Gallery into debug mode you can see all the Smarty variable information available to you in the Smarty Debug popup window:
FAQ: How to set/use Gallery in debug mode?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22892
Posted: Sat, 2009-08-22 01:22

Is this what you are after:
http://gallery.menalto.com/node/73028

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nlao
nlao's picture

Joined: 2005-08-06
Posts: 18
Posted: Sat, 2009-08-22 12:01

Utterly brilliant. Dave you are a genius! Code I used from the above link to capture the album one above root.

{foreach name=parent from=$theme.parents item=parent}
   {if $smarty.foreach.parent.total ==1}
   {* DISPLAY CURRENT ALBUM TITLE *}
    <p><a href="">{$theme.item.title|default:$theme.item.pathComponent|markup:strip}</a></p>
   {elseif $smarty.foreach.parent.iteration ==2}
    {* DISPLAY FIRST CHILD AFTER ROOT OF CURRENT ALBUM TREE *}
   <p><a href=""> {$parent.title|markup:strip|default:$parent.pathComponent}</a></p>
  {/if}
{/foreach}

I added the href so I can link back to my home page using the title.

I also came up with this last night which almost achieves the same thing and might be useful for someone else. If its an album display the name of the album. If its a photo display the parent album.

{if $theme.pageType == 'album'}
	<p><a href="">{$theme.item.title|markup}</a></p>
{elseif $theme.pageType == 'photo'}
	<p><a href="">{$theme.parent.title|markup}</a></p>
{/if}
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22892
Posted: Sat, 2009-08-22 14:14

Glad you got it sorted and posting your findings for others.
HOw does it feel to be a theme developer now? :-)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nlao
nlao's picture

Joined: 2005-08-06
Posts: 18
Posted: Sat, 2009-08-22 15:40

Well I have a couple of other bits to sort out, once I have done that I could call myself a theme developer! :D