Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

category_linked separator to HTML

Quote Reply
category_linked separator to HTML
Greetings:

To fit in with the rest of my site, I need to change the following Links Global 'separator' value from > to display some HTML code, in particular something similar to <span>&nbsp;</span>.

I tried to just replace the > part with the <span> tags but get a compilation error. Does anyone have any ideas how I can achieve this?
Existing code is as follows:-

Code:
sub {
require Links::Utils;
require Links::Build;
my $tags = shift;
my $catid = $DB->table('CatLinks')->select('CategoryID', { LinkID => $tags->{ID} })->fetchrow;
my $full_name = $DB->table('Category')->select('Full_Name', { ID => $catid })->fetchrow;
return (Links::Utils::format_title(Links::Build::build_title($full_name), separator => " > ", link_type => 1, ));
}

Thanks,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] category_linked separator to HTML In reply to
Hi,

I guess it depends on which way you want to approach it.

Personally, I would do it like:

<%new_title_linked($title_loop)%>

Code:
sub {

my $title_loop = $_[0];

my $back;
$back .= qq|<a href="">Home</a> |;

foreach (@$title_loop) {
$back .= qq|: <a href="$_->{URL}">$_->{Name}</a> |;
}

return $back;

}

I'm not 100% sure what you are trying to do, but is it something like:

Code:
$back .= qq|: <span><a href="$_->{URL}">$_->{Name}</a></span> |;

Anyway, 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] category_linked separator to HTML In reply to
Hmm..

That's a bit confusing ...

The category_linked global comes stock standard with Links. It shows the Category that the individual link is in.

At the moment it shows:-

Category > SubCat > SubCat etc...

What I need it to show is:

Category (some html) SubCat (some html) etc .....


Thanks,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] category_linked separator to HTML In reply to
Hi,

Mmm.. I'm assuming the problem is lying with the fact it HTML encodes the output?

Maybe try:

<%set the_value = Links::Tools....%>
<%html_unescape $the_value%>

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] category_linked separator to HTML In reply to
Hi Andy:

I'm getting closer ....

This is the problem bit of the code I cannot work out:-

Code:
return (Links::Utils::format_title(Links::Build::build_title($full_name), separator => " > ", link_type => 1, ));

When I change the above to this:-

Code:
return (Links::Utils::format_title(Links::Build::build_title($full_name), separator => " <span class="crumb">&nbsp;</span> ", link_type => 1, ));

I get a compilation or similar error .... there is obviously something I am doing wrong with the syntax...

Regards,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] category_linked separator to HTML In reply to
Hi,

Its because you are using "" inside " "

Try:

Code:
q| <span class="crumb">&nbsp;</span> |

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!