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
Posts: 22892
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
Posts: 24
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
Posts: 24
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:
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
Posts: 6138
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