home link in the bredcrumbs

gbuchana

Joined: 2008-01-15
Posts: 3
Posted: Tue, 2008-01-15 23:47

I'm running Gallery 1.5.4_1 on FreeBSD and it seems to work great.
I would like to add a home link amongst the breadcrumbs though.
As near as I can work out David Brown's patch (http://gallery.menalto.com/wiki/Addition_of_Home_link) Addition of Home link would be a good fit.

It's not obvious that this patch is meant for Gallery 2.x, but close inspection shows that the files it's trying to patch are not much like the 1.5.4 ones I have.

Has anyone done this? Any pointers to a 1.x method for handling this?

If I use the html_wrapper to handle this, can I just stick a regular link in there? That would be a good second choice.

Thanks.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-01-16 03:22

Yes that patch is for G1, I don't know the version. Try it and see if it works. If net then regular links in the html_wrap file(s) should do the trick..

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
gbuchana

Joined: 2008-01-15
Posts: 3
Posted: Wed, 2008-01-16 03:57

Thanks. I have put the links in the gallery, album and photo.header. It's not really what I wanted, but it will work.

The patch is definitely not for 1.5.4 -- not even close. I looked at all the files it is trying to patch and none is a close match to what the patch expects, except config.php. Every single chunk rejects.

What module builds the "slide show", "view comments", "logon" links? I would consider adding my home link there. I can put a "home" logo and a link under it to lead back to home-base. I think that would look pretty good too.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-01-16 04:38

Its been a long time since I have worked on G1 so I might be a bit rusty.
edit layout/breadcrumb.inc
find

	<td class="bread" style="text-align:<?php echo langRight(); ?>; padding-left: 5px; padding-right: 5px;">
	<?php
	if (isset($breadcrumb['text'])) {
	    foreach($breadcrumb["text"] as $nr => $text) {
	        echo "\t\t$text\n";
	    }
	}
	?>
	</td>

and you should be able to add your link like regular html like:

	<td class="bread" style="text-align:<?php echo langRight(); ?>; padding-left: 5px; padding-right: 5px;">
        <a href="http://example.com">Home</a>
	<?php
	if (isset($breadcrumb['text'])) {
	    foreach($breadcrumb["text"] as $nr => $text) {
	        echo "\t\t$text\n";
	    }
	}
	?>
	</td>

I hope I am right :-)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Wed, 2008-01-16 09:08

Hi,

this patch is from 2001, so its definitely for a Version 1.2.x

@gbuchana: What did you expect? I see an interesting point in this patch.

Jens
--
Last Gallery v1 Developer.
Tryout the TEST-Version of Gallery 1.6

 
gbuchana

Joined: 2008-01-15
Posts: 3
Posted: Wed, 2008-01-16 21:02

1.2.x? Explains why the patch wouldn't apply.

I've implemented a patch to add links to the main actions (next to where the login link appears). I've stuffed this code in after the login link (uses identity.gif) in view_photo.php, view_album.php and albums.php and stuck suitable icons in images/icons. It seems to work as I wanted.

/* ####### new stuff
*/
$iconText = getIconText('home.gif', gTranslate('core', "home"));
$iconElements[] = '<a href="/">'. $iconText .'</a>';

$iconText = getIconText('twiki.gif', "twiki");
$iconElements[] = '<a href="/twiki/bin/view/Main">'. $iconText .'</a>';

I will look at the breadcrumb code now and see if I can puzzle that out.

Thanks for your help everyone.

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Wed, 2008-01-16 21:37

You could short it even more ;-)

$iconElements[] = galleryIconLink('/twiki/bin/view/Main', 'home.gif', gTranslate('core', "home"));

*g*

Jens
--
Last Gallery v1 Developer.
Tryout the TEST-Version of Gallery 1.6