Gossamer Forum
Home : Products : Gossamer Links : Discussions :

<%title_linked%> without the title on the end

Quote Reply
<%title_linked%> without the title on the end
Does anyone have any idea how to do this?

[i.e. so that Home : Dogs : Big Dogs : My dog from kentucky is great is displayed as Home : Dogs : Big Dogs on detailed.html]
Quote Reply
Re: [Donald Rumsfeld] <%title_linked%> without the title on the end In reply to
Done.



sub {my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {$name =~ s/ /_/g;
$cat = "<a href=$name>$name</a>";
}return $cat;
}
Quote Reply
Re: [Donald Rumsfeld] <%title_linked%> without the title on the end In reply to
>>>{$name =~ s/ /_/g; <<<

Why are you replacing spaces with underscores here? Unsure

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] <%title_linked%> without the title on the end In reply to
So the URL is correct. Otherwise it wouldn't work.
Quote Reply
Re: [Donald Rumsfeld] <%title_linked%> without the title on the end In reply to
Code:
sub {
my $full_name = shift;
print Links::Build::build('title_linked', { complete => 0, home => 1, name => $full_name });
}

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] <%title_linked%> without the title on the end In reply to
You might need:

require Links::Build;
Quote Reply
Re: [Paul] <%title_linked%> without the title on the end In reply to
Yes, true.

Now that I think about it, you could probably just put the above in a tag, and you won't need the require:

<%Links::Build::build('title_linked' , { complete => 0, home => 1, name => $Full_Name })%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] <%title_linked%> without the title on the end In reply to
Either way will probably be the same as GT::Template will still require Links::Build using a tag rather than a global.
Quote Reply
Re: [yogi] <%title_linked%> without the title on the end In reply to
That doesn't work for me. It just prints

Home : { complete
Quote Reply
Re: [Paul] <%title_linked%> without the title on the end In reply to
This works for me:

sub {my ($rec) = @_;
require Links::Build;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {$name =~ s/ /_/g;
$cat = $name;
}
return Links::Build::build('title_linked', { complete => 1, home => 1, name => $cat});
}



Much prettier than before.

The So Solid Crew would like to thank : Yogi, Paul.

Last edited by:

Donald Rumsfeld: Jul 13, 2002, 6:40 AM
Quote Reply
Re: [Donald Rumsfeld] <%title_linked%> without the title on the end In reply to
>>
while (my ($id,$name) = $sth->fetchrow_array) {$name =~ s/ /_/g;
<<

Why do you select the $id and also why select $name and then assign it to $cat....why not just use $cat in the first place? Angelic

Last edited by:

Paul: Jul 13, 2002, 6:45 AM
Quote Reply
Re: [Paul] <%title_linked%> without the title on the end In reply to
Originally because it was left over from an earlier piece of code, which I didn't clean out. You are very right though, in that it is useless.
Quote Reply
Re: [,] <%title_linked%> without the title on the end In reply to
Hi,

Works fine - but I'd like to get rig of the _ in the name - I realize it needs to be there for the URL to work, just don't want it to show in the name.

Any ideas?

Klaus

http://www.ameinfo.com