How can I generate just the penultimate breadcrumb URL ??

VictorZ

Joined: 2007-09-20
Posts: 24
Posted: Sun, 2009-09-06 17:05

I'd like to place an icon in the navigation bar that would move the user back one level from where they are. In other words, if he/she is looking at images, the icon would bump them back to the thumbnail page. If on the thumbnail page, it would bump them back up to the sub/album page that holds the images, etc.. Essentially, I want to know how to generate the penultimate (next to last) item on the breadcrumb trail. My lack of PHP/smarty understanding is standing in the way, but it seems this shouldn't be that difficult. I've already figured out how to customize and/or rearrange the navigator bar to my liking, so once I have the penultimate URL, I can easily assign an icon to that for the user to click on.

Any help in this matter would be appreciated!

Thanks in advance,

Victor Z

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22892
Posted: Sun, 2009-09-06 19:12

Does the breadcrumb not work?

Anyway;
add to photo.tpl

<a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$theme.item.parentId`"}">
UP
</a>

you can change the UP to {$theme.parent.title}

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
VictorZ

Joined: 2007-09-20
Posts: 24
Posted: Sun, 2009-09-06 19:55

Floridave,

No, the breadcrumb works just fine ... and I intend to leave it in place. I just want to have a more visual method of providing a "back" (more accurately, an "up one level") function as some people didn't immediately understand that the breadcrumb trail was how to accomplish that function.

Thank you very much for the quick reply! I'm going off to edit that in and see how it works.

Victor

 
VictorZ

Joined: 2007-09-20
Posts: 24
Posted: Mon, 2009-09-07 15:33

Dave,

Just a follow up. The code snippet you provided works just fine. My only issue was that it always opened up the first page of thumbnails instead of going back to the page where the picture currently being viewed came from. I was able to figure out the following modification to the code so that the behavior is more like the breadcrumb trail ... that is, goes back to the page it came from.

Changed $theme.item.parentID to $theme.item.id ... Modified code snippet:

Quote:
<div class="buttonUpOneLevel">
<a href="{g->url arg1="itemId=`$theme.item.parentId`" arg2="highlightId=`$theme.item.id`"}";
title="{g->text text="Back To Index"}"></a>
</div>

I'm sure there must be a place where all these variables are explained/defined ... probably the Codex? I really do need to spend some more time in there but I've not had the best luck in finding what I'm looking for, often just stumbling on answers through luck or serendipity.

Thanks once again for your help and suggestions!

Victor

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6138
Posted: Mon, 2009-09-07 18:12

http://codex.gallery2.org/Gallery2:Themes

or how about <a href="javascript:history.go(-1)" title="Back">Back</a>

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2