Adding 'back to parent album' link?

uomeds10

Joined: 2006-11-30
Posts: 20
Posted: Sun, 2009-08-23 00:50

I am quite happy with Matrix, but I want to make a small change I am hoping some here might be able to help with.

The Drupal site I am using it with does not use breadcrumbs, so to provide users with a similar 'go back' type functionality, I want to add a 'back to parent album' link.

What I'd ideally like would be a link that on album.tpl that when clicked takes you back to the album the album you are viewing belongs to. If you are already at the highest album (based on URL perhaps - eg. sitename.com/gallery), no link should be displayed.

On photo.tpl, the same would apply, only the link should always be displayed and just similarly take you back to the album that photo belongs to.

Would this be difficult? Can anyone help me out with how it should go?

Thanks.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2009-08-23 05:06

http://gallery.menalto.com/node/90350

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
uomeds10

Joined: 2006-11-30
Posts: 20
Posted: Tue, 2009-11-17 02:21

Thanks Dave it worked like a charm, but now I think I'd be better off with a full breadcrumb. Is there anywhere I can find the code to insert for that where desired in album.tpl and photo.tpl?

ie. Gallery > Album > Picture

Thanks again.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2009-11-17 04:40

Glad that worked , never tired it.
any way you could try
modules/core/templates/blocks/BreadCrumb.tpl

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
uomeds10

Joined: 2006-11-30
Posts: 20
Posted: Tue, 2009-11-17 06:05

Okay, I suppose that was kind of dumb of me. All I had to do was insert:

{g->block type=core.BreadCrumb [separator=..]}

Works fine. The only thing I'd like to customize is to hide currently viewed item name (lowest/last breadcrumb item). There's already a title stating it on the page. It's redundant.

My current breadcrumb.tpl reads:

<div class="{$class}">
  {foreach name=parent from=$theme.parents item=parent}
  <a href="{g->url params=$parent.urlParams}" class="BreadCrumb-{counter name="BreadCrumb"}">
    {$parent.title|markup:strip|default:$parent.pathComponent}</a>
  {if isset($separator)} {$separator} {/if}
  {/foreach}

  {if ($theme.pageType == 'admin' || $theme.pageType == 'module')}
  <a href="{g->url arg1="view=core.ShowItem"
		   arg2="itemId=`$theme.item.id`"}" class="BreadCrumb-{counter name="BreadCrumb"}">
     {$theme.item.title|markup:strip|default:$theme.item.pathComponent}</a>
  {else}
  <span class="BreadCrumb-{counter name="BreadCrumb"}">
     {$theme.item.title|markup:strip|default:$theme.item.pathComponent}</span>
  {/if}
</div>

Again, any help is appreciated.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2009-11-17 14:11

You should just have to remove the last span:

<span class="BreadCrumb-{counter name="BreadCrumb"}">
     {$theme.item.title|markup:strip|default:$theme.item.pathComponent}</span>

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team