Adding 'back to parent album' link?
uomeds10
Joined: 2006-11-30
Posts: 20 |
![]() |
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
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
http://gallery.menalto.com/node/90350 Dave |
|
uomeds10
Joined: 2006-11-30
Posts: 20 |
![]() |
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
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
Glad that worked , never tired it. Dave |
|
uomeds10
Joined: 2006-11-30
Posts: 20 |
![]() |
Okay, I suppose that was kind of dumb of me. All I had to do was insert:
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
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
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 |
|