Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 10:56 am EDT

Geeklog Forums

Open RDF feed link in new window


3PRIMATES

Anonymous
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
 Quote

Status: offline

sardu

Forum User
Junior
Registered: 01/23/03
Posts: 17
   ...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>';

[code]

---
Lucas Thompson, sardu@mac,com


Lucas Thompson, sardu@mac,com
 Quote

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"
 Quote

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
 Quote

All times are EDT. The time is now 10:56 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content