Posted on: 03/20/03 09:35pm
By: Anonymous (3PRIMATES)
Hello,I dont always agree that it is a good idea to spawn new windows for links, but in the case of RDF news links I DO think it is a good idea.The user of your site is expecting to be able click more than one link without having to backtrack through all the links they followed inside a news story.It took me awhile to figure this out, I was trying to make it harder than it was..To have your RDF links spawn in a new window change the following line in:lib-common.phpline number: 3131$RDFheadlines[] .= '<a href="' . addslashes( trim( $RDFlink )) . '" ' . addslashes( trim( $RDFtitle )) . '</a>';Add:target="_blank" at the end of the href stringexample:$RDFheadlines[] .= '<a href="' . addslashes( trim( $RDFlink )) . '" target="_blank">' . addslashes( trim( $RDFtitle )) . '</a>'; Hope it helps..3PRIMATES
Re: Open RDF feed link in new window
Posted on: 03/21/03 07:51am
By: sardu
...user of your site is expecting to be able click more than one link without having to backtrack...
Who told you what I was expecting from your site? I was trying to keep it a secret! : )
Seriously though, I usually open links in another browser tab or a new window and generally I assume that a link will open in the same window unless the site states otherwise.
And just so this comment isn't devoid of useful information I'll add that using the target=
attribute prevents XHTML 1.1 validation, you can use onclick=
and a simple window.open
call instead:
$RDFheadlines[] .= '<a href="' . addslashes( trim( $RDFlink )) . '" inclick="window.open(this.href,'');return false;">' . addslashes( trim( $RDFtitle )) . '</a>';
---
Lucas Thompson, sardu@mac,com
Re: Open RDF feed link in new window
Posted on: 04/04/03 04:48am
By: Anonymous (Anonymous)
your code has caused
"Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in f:inetpubwwwrootwww.doggpark.compublib-common.php on line 3112"
Open RDF feed link in new window
Posted on: 04/04/03 04:51am
By: Anonymous (Anonymous)
Incorrect. The correct code is
$RDFheadlines[] .= '<a href="' . addslashes( trim( $RDFlink )) . '"onclick="window.open(this.href);return false;">' . addslashes( trim( $RDFtitle )) . '</a>';
you had extra characters after this.href