Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Breadcrumb home link to point to home page instead to default location in version 3.3.0

Quote Reply
Breadcrumb home link to point to home page instead to default location in version 3.3.0
Hi,

I upgraded to version 3.3.0 and the top breadcrumbs link points to http://www.example_URL.com/pages/index.html instead to http://www.example_URL.com. In the past I would change build_title_linked on line 1080 in Build.pm, but now I can't find the right place.

Can somebody point me to the right direction please?

Thank you,

Z
Quote Reply
Re: [Z] Breadcrumb home link to point to home page instead to default location in version 3.3.0 In reply to
Hi,

A better way than trying to do that, may be to edit your templates:

Code:
<%set $title_loop.1.URL = "http://www.yoursite.com/"%>

Hopefully that should do the trick. This way you don't have to worry about future upgrades breaking it =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Breadcrumb home link to point to home page instead to default location in version 3.3.0 In reply to
Thanks Andy, but where exactly should I insert the code in the templates?

Here is an example of a template, where should I enter the code?

<td valign="middle"><font face=Arial color="#000099"><b><strong class="title"> </strong></b></font> <font face=Arial><b><strong class="title"> <font color="#000099"> &nbsp;
<%title_linked%>
</font></strong></b></font>
<!-- Subcategories-->
<%if category%>
<font size="5">&nbsp; </font> </td>
</tr>
Quote Reply
Re: [Z] Breadcrumb home link to point to home page instead to default location in version 3.3.0 In reply to
Hi,

I expect you will need a global to do that then (totally untested)

rewrite_breadcrumb
Code:
sub {
my $breadcrumb = $_[0];
my $home_url = "http://www.yoursite.com/pages/";
my $new_url = "http://www.yoursite.com/";
$breadcrumb =~ s/\Q"$home_url\"/"$new_url"/;
return \$breadcrumb;
}

Then change this in your templates:

Code:
<%title_linked%>

..to:

Code:
<%rewrite_breadcrumb($title_linked)%>

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Breadcrumb home link to point to home page instead to default location in version 3.3.0 In reply to
Thanks Andy.

You are dealing with and amateur here Smile


I don't even know what a global is. It seems like the name of the global is rewrite_breadcrumb, and you gave me the code, and showed me how to point to it.

I still don't know how to create the global. Is it a separate file, or just a part of a different file? How should I name it if it is a separate file? Where to place it if it is part of a separate file. Where to place the global if it is a separate file?

If this doesn't work I wouldn't mind to do what I was doing in the past, editing build_title_linked. Is that still possible, and if yes what line do I need to edit?

Thanks,

Z
Quote Reply
Re: [Z] Breadcrumb home link to point to home page instead to default location in version 3.3.0 In reply to
Hi,

NP. You would do it in Build > Template Globals, then goto the bottom of that page - where it lets you add a new one

Regarding editing the code itself, I'm not sure - I've never bothered editing the core code if I didn't need to, and thats one of the things I've never had to do it for =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Breadcrumb home link to point to home page instead to default location in version 3.3.0 In reply to
It didn't work.

I created new template global called rewrite_breadcrumb ->

sub {
my $breadcrumb = $_[0];
my $home_url = "http://www.my-website.com/pages/";
my $new_url = "http://www.my-website.com/";
$breadcrumb =~ s/\Q"$home_url\"/"$new_url"/;
return \$breadcrumb;
}

then I replaced <%title_linked%> with <%rewrite_breadcrumb($title_linked)%> in the template ->

<table width="101%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle"><font face=Arial color="#000099"><b><strong class="title"> </strong></b></font> <font face=Arial><b><strong class="title"> <font color="#000099"> &nbsp;
<%rewrite_breadcrumb($title_linked)%>
</font></strong></b></font>
<!-- Subcategories-->
<%if category%>
<font size="5">&nbsp; </font> </td>
</tr>
</table>

After running "Build All" instead of a breadcrumb on the pages I get this -> REF(0x8a1b924)




Z
Quote Reply
Re: [Z] Breadcrumb home link to point to home page instead to default location in version 3.3.0 In reply to
Smile After playing with Build.pm I got it.

To make it work I changed code in Build.pm on line 1125


from

push @paths, qq{<a href="$CFG->{build_root_url}/} . ($CFG->{build_home} || ($CFG->{build_index_include} ? $CFG->{build_index} : '')) . qq{">$top</a>} if $home;

to


push @paths, qq{<a href="http://www.my-website.com"">$top</a>} if $home;




Z
Quote Reply
Re: [Z] Breadcrumb home link to point to home page instead to default location in version 3.3.0 In reply to
Mmm, in that global - what happens if you change

Code:
return \$breadcrumb;

..to:

Code:
return $breadcrumb;

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Breadcrumb home link to point to home page instead to default location in version 3.3.0 In reply to
Andy,

I really appreciate your help, but now there is no need to test globals anymore since Build.pm code change took care of the problem.
It seems like another upgrade is not likely in near future, and this is a long time solution for me.

Thank you one more for your time and effort.

Z