Gossamer Forum
Home : Products : Links 2.0 : Customization :

Change sub "site_html_link" to build standard html links?

Quote Reply
Change sub "site_html_link" to build standard html links?
I'd like to change the subroutine "sub site_html_link" in "site_html_templates" to produce
standard html links like this:

<ul><li><font face="arial size="2">
<a class="link" href="http://www.everythingroyal.com"> Everything Royal</a></font>
<font face="arial size="2">- Catalog of English and Russian Royal Family commemoratives and memorabilia. - </font><font face="arial size="2">(Added: 31-Jul-2004)</font></ul>

Rather than this:

<ul><li><font face="arial size="2">
<a class="link" href="http://www.booksmusicvideo.com/cgi-bin/links/jump.cgi?ID=10"> Everything Royal</a></font>
<font face="arial size="2">- Catalog of English and Russian Royal Family commemoratives and memorabilia. - </font><font face="arial size="2">(Added: 31-Jul-2004)</font></ul>

Can this be done fairly easily?

Thanks for any help you can provide..




Here is the subroutine:

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
my %rec = @_;
# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
-----------------------------------------------------------
Professional Search Engine Marketing by Position Concepts Professional Consulting in SEM, SEO and PPC.
Quote Reply
Re: [poscon] Change sub "site_html_link" to build standard html links? In reply to
Very easy, and discussed before... (ie: did you search first?)

See this in the routine?

return &load_template ('link.html', {

That means the look of the link is coming from link.html, in the template file. Go there, and see this:

... href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a>

Change it to this:

... href="<%URL%>"><%Title%></a>

Since you will no longer be counting how many clicks a link gets, you can remove the link to the What's Popular page, too.

[href code edited to not be a link in the post, missing <a ...]


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Change sub "site_html_link" to build standard html links? In reply to
perlflunkie,

I did search, but I didn't find it...

Anyway, your solution is excellent!

Thank you VERY much.
-----------------------------------------------------------
Professional Search Engine Marketing by Position Concepts Professional Consulting in SEM, SEO and PPC.