Gossamer Forum
Home : Products : Links 2.0 : Customization :

Url on Links instead of jump.cgi

Quote Reply
Url on Links instead of jump.cgi
Is it possible to have the url showing up on the links, for the benefit of search engines, as well as being able to use jump.cgi to count hits.

i.e. When they click on the link it will take them to the link web address and also activate jump.cgi to count the links.

Web address is http://www.gardenbuildings.com/...ctory/United_States/

Program Links 2.0 using site.html to produce the output. I think this is where the links are produced.

##########################################################
## A Link ##
##########################################################

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like. It's a little complex looking just because we have to
# check for blank entries..

my (%rec) = @_;

$output = qq~<$font><ul><li><b><a href="$build_jump_url?$db_key=$rec{$db_key}">$rec{'Title'}<small> - $rec{'Town'}, $rec{'State'}.</small></a></b><br>~;


if ($rec{'Member Status'} eq "Full") { $output .= qq~ <a href="$build_detail_url/$rec{$db_key}$build_extension"><IMG SRC="$build_root_url/images/member1.gif" WIDTH=36 HEIGHT=13 ALT="" BORDER="0"></a> - ~; }

if ($rec{'Description'}) { $output .= qq~ $rec{'Description'}\n~; }

$output .= qq~ </ul></font>
~;

return $output;
}
Quote Reply
Re: [robinantill] Url on Links instead of jump.cgi In reply to
search this forum for <%URL%> javascript, the only way of doing it is via javascript to utilize jump.cgi, but also "show" the URL.

BTW: Search engines do index dynamic web pages, so it's not that big of a deal.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Url on Links instead of jump.cgi In reply to
Do you want the URL in addition to, or instead of, the link title?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Url on Links instead of jump.cgi In reply to
I would like the URL as well as the link title. Thanks.
Quote Reply
Re: [robinantill] Url on Links instead of jump.cgi In reply to
I found this post and followed the instructions, but this does not create a active link to the link, only the links name. Is there something missing to make the link active? Do you need to specify that the code is javascript, and if so, how? Thanks.

http://www.gossamer-threads.com/...cgi?post=26233#26233
Quote Reply
Re: [robinantill] Url on Links instead of jump.cgi In reply to
there may be an error in the code for the referenced post. Depends on how your links.def reads.

Code:
$output = qq|
<ul type=disc><li><$font><a href="$build_jump_url?$db_key=$rec{$db_key}"
onMouseOver="window.status='$rec{'url'}'; return true">$rec{'Title'}</a></font>|;




$output = qq|
<ul type=disc><li><$font><a href="$build_jump_url?$db_key=$rec{$db_key}"
onMouseOver="window.status='$rec{'URL'}'; return true">$rec{'Title'}</a></font>|;


and you may want to add the onmouseout to clear the status bar

Code:
$output = qq|
<ul type=disc><li><$font><a href="$build_jump_url?$db_key=$rec{$db_key}"
onMouseOver="status='<%URL%>'; return true" onMouseOut="status=''; return true">
$rec{'Title'}</a></font>|;


and couldn't you do something like the following:

Code:
$output = qq|
<ul type=disc><li><$font><a href="$build_jump_url?$db_key=$rec{$db_key}"
onMouseOver="status='<%URL%>'; return true" onMouseOut="status='';
return true">$rec{'Title'}</a></font><a href="<%URL%>"></a>|;


the first a href would be clickable and the jump would still record the hit while the second a href would appear in the html but would not be clickable.

but then maybe I should have a cup of coffee this morning before I try to do any serious thinking. Unsure


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."

Last edited by:

esm: Jan 30, 2003, 4:06 AM
Quote Reply
Re: [esm] Url on Links instead of jump.cgi In reply to
esm: This idea of using JavaScript is flawed anyway, as very few (if any) search engine robots understand it, and even if they did, they can't "mouseover" a link.

robinantill: Why are you so worried about whether search engine robots index other people's sites anyway?
Quote Reply
Re: [wysardry] Url on Links instead of jump.cgi In reply to
actually, your comment on the javascript should probably be directed to robinantill. I am still not quite sure what he wants or why he wants it. I was merely offering ideas ( and sleepy ideas at that Tongue ) that might trigger a solution for him.

Since you do know what he wants AND why that would not be beneficial for him, direct your comments to him as why the ideas won't work and why they won't benefit him.

As for your comment even if they did, they can't "mouseover" a link you might want to look a little closer at what I did write.

Code:
<a href="$build_jump_url?$db_key=$rec{$db_key}"
onMouseOver="status='<%URL%>'; return true" onMouseOut="status='';
return true">$rec{'Title'}</a></font><a href="<%URL%>"></a>|;


Ain't no mouseover in the second a href, baby! if there is, I need something stiffer than coffee in the morning!!! Crazy Will search engine robots see that???? I am neither too old nor too proud to learn something new.

but as for whether there is any benefit for robinantill, you can debate that with him/her. While I am willing to share what little bit of knowledge I have and accept corrections for errors based on that limited knowledge, I try to stay out of debates. Well, at least debates of this type. If it is a waste of his time, money and/or resources, then that is his problem and not mine.

Hell, just tell robinantill he has received dumb answers to an even dumber question and stop wasting everybody's time with such drivel.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."

Last edited by:

esm: Jan 30, 2003, 6:08 AM
Quote Reply
Re: [wysardry] Url on Links instead of jump.cgi In reply to
Quote:
esm: This idea of using JavaScript is flawed anyway, as very few (if any) search engine robots understand it, and even if they did, they can't "mouseover" a link.

I think perhaps you misread the original post. The OP wanted the URL as the hyperlink for the search engine exposure - the javascript was to track hits with jump.cgi

So although you are right that search engines can't mouseover links, it is not a problem in this situation.

At least thats how I read it.

esm was simply pointing out a mistake in the code and then suggesting an addition to remove the mouseover text is the status bar.

Last edited by:

Paul: Jan 30, 2003, 5:52 AM
Quote Reply
Re: [Paul] Url on Links instead of jump.cgi In reply to
Anyway, to get back to the question...

Another question: do you want to display the URL as just text, or as a link? This tag $rec{'url'} will call the actual URL ofthe link. You can add the href code to make it "hot" if you want...

The code in the other forum was so that the Title would display normally, and when pointed to (mouseover) would show the URL. A bit much, I think...


Leonard
aka PerlFlunkie
Quote Reply
Re: [esm] Url on Links instead of jump.cgi In reply to
Thank you for your reply. With your help I have the link showing on the directory page and when it is clicked on it also registers the 'hit'. Ths is is just what I wanted.

In spite of other persons thinking there is no logic to my problem. The reason I wanted to do this is because I am encouraging other web sites to link to mine, and on theirs the link back to me a a true url address, whereas the link to them came up as ..../jump.cgi?ID... Whether this shows up and is indexed by a search engine is irrevelent if the other web site perceives that I am trying to hide his address.

This may be 'bread and butter' for most of the contributers to this forum but to me it is a vital part of learning how to maximise my directory to hte best of my ability (might not be a lot, but I do enjoy it). I apologise if some people think it is a dumb question.

Thank again ESM, Paul and PerlFlunkie
Quote Reply
Re: [robinantill] Url on Links instead of jump.cgi In reply to
glad you were able to get it to work the way you wanted. I learned a long time ago that folks do things differently than I what I may do.

Just to clarify, it was Stealth who provided the info pointing to the solution.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Url on Links instead of jump.cgi In reply to
Okay, I could have written two separate replies, but as my comments were short, I thought I'd combine them into one post to save time and forum space.

The only reason I knew why he/she wanted this mod was because of the first two paragraphs of the initial post.

I'm not sure that search engines will see an empty anchor tag such as you have in your code, which was why I made the comment I did. If you (or someone else) is sure that they will, then I can accept your solution.

My intent was not to start an argument, but a debate can often be useful if both sides are open minded enough to learn something new.

I see no reason to make rude comments in the process.
Quote Reply
Re: [robinantill] Url on Links instead of jump.cgi In reply to
I simply asked what your reason was to do this, I did not say the logic was flawed. If I knew why you wanted to include the real URL and use jump.cgi I may have been able to offer an alternative way of doing the same thing.

Sheesh, did everybody get out the wrong side of the bed this morning or what?
Quote Reply
Re: [wysardry] Url on Links instead of jump.cgi In reply to
well, you did use the word "flawed." Plus, the post came across in a somewhat negative manner (IMHO). I certainly apologize if I overreacted. I know that sometimes what we write comes across differently than what we intended.

No biggie.

exchanging ideas and info is a good idea.

And I look forward to exchanging ideas with you Smile in the future . I certainly need all the help I can get from the good folks here...Cool


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Url on Links instead of jump.cgi In reply to
Yes, I said to you that the idea of using JavaScript was flawed for the particular use that robinantill wanted to put it. That was meant as a constructive criticism, and was not meant to imply that robinantill's desire to show the URL was flawed.

I thought that putting your respective nicks beside each comment would have made it clearer who they were directed to.

Perhaps I should have gone into more detail and/or offered an alternative, but I was just about to log off and was hoping it would spur someone else to offer an alternative suggestion.
Quote Reply
Re: [robinantill] Url on Links instead of jump.cgi In reply to
Now that I know why you want to display the URL, I can suggest an alternative to using JavaScript (which only works in certain browsers) that is more in line with the way sites like Yahoo handle this.

1. Add the URL as plain text near the description for the link.
2. Edit the link to include the URL as well as the ID.
i.e. http://www.yoursite.com/cgi-bin/jump.cgi?ID=4&URL=http://www.example.com

In other words, in the "link.html" template, add <%URL%> wherever you'd like the plain text URL to display and change this line:-

Code:
<a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>">

to

Code:
<a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>&amp;URL=<%URL%>">

The jump.cgi script will completely ignore the &URL= part and use the ID as normal (so don't remove the ID part unless you edit jump.cgi to handle the change). However, your visitors won't know it's purely cosmetic.
Quote Reply
Re: [wysardry] Url on Links instead of jump.cgi In reply to
Just to clarify, there is a difference in the code for use in templates or non-templates (site_html_templates.pl vs. site_html.pl). Using a tag like <%this%> is for use in templates, while code like $rec{'url} is for non-templates. I use templates, but I believe this correct.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Url on Links instead of jump.cgi In reply to
Yes, you're right. I'd actually lost track of whether the original poster was using templates or not as the forum automatically jumps to the newest post, and I hadn't scrolled back.

What added to the confusion was the curious mixture of template and non-template code in a couple of the examples.

I believe that 'url' is normally 'URL', but I'm not 100% certain. It's easy enough to check the existing code though.