View previous topic :: View next topic |
Author |
Message |
alanmarx
Joined: 21 Jul 2004 Posts: 1
|
Posted: Wed Jul 21, 2004 9:01 pm Post subject: Links in seperate windows |
|
|
Is there a way to set up my blog so that when someone clicks on a link, it opens in a seperate window instead of taking over the blog page? I want to put links in my posts, but I don't necessarily want to send people off of my page in the middle of reading a post.
Thanks |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Wed Jul 21, 2004 10:01 pm Post subject: Re: Links in seperate windows |
|
|
A little while back I did some research in response to this issue, and came up with a neat solution...
You use HTML to create normal links like this:
Code: | <a href="http://www.blogharbor.com">BlogHarbor</a> |
By adding a TARGET attribute of _blank, you can make a link which will open up in a new window:
Code: | <a href="http://www.blogharbor.com" target="_blank">BlogHarbor</a> |
You should be able to use the Toggle Mode button at the bottom right side of the Rich text editor (next to the smilies button) to toggle to the View Source mode, enabling you to view the raw HTML of your post and to insert these target attributes by hand.
However, it would be much easier to figure out how to make all links to other sites automatically open in a new window, while leaving links to your open pages to opening in the default manner.
Well, here's a way to do that...
First, create an empty file on your local hard disk called xhtml-target.js and save it. Copy the contents of this URL to that file:
http://www.fastmedia.com/hacks/xhtml-target.js.txt
Now upload your xhtml-target.js file to your weblog using the File Manager.
Next, go to the Settings & Security tab in the blog control panel and click the link to General settings. Scroll down on this General Settings page until you see the Additional <HEAD> Content row and place the following code in that form box:
Code: | <script type="text/javascript" src="/xhtml-target.js"></script> |
then click the Save Settings button. Now your weblog should open all outside links in a new window, but your internal links will function as usual.
Note: I learned this technique from a great article: New-Window Links in a Standards-Compliant World and a comment in reference to that article.
Note: 7/23/04 - There was an error in one of the file names - I edited this entry to correct it.
Note: 10/5/04 - Revised to reflect new control panel interface.
Last edited by john on Tue Oct 05, 2004 11:59 am; edited 3 times in total |
|
Back to top |
|
|
vtmnldy Guest
|
Posted: Tue Oct 05, 2004 11:29 am Post subject: Missing Link |
|
|
Quote: | Next, go to the Settings tab in the blog control panel and click the link to "Add additional <HEAD> content." |
I cannot find this link. Could someone please clarify?
Thank you!
Lynn |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Tue Oct 05, 2004 11:51 am Post subject: Re: Missing Link |
|
|
With our user interface update of 9/21 the location moved to: Settings & Security > Publishing Defaults > General.
Scroll down on this General Settings page until you see the Additional
<HEAD> Content row; place the code in that form box and click the Save Settings button.
I will revise the original instructions... |
|
Back to top |
|
|
qureus Guest
|
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Tue Feb 15, 2005 12:20 am Post subject: Re: can you tell me what I did wrong |
|
|
It looks like there was a problem somehow on the formatting of the xhtml-target.js file you uploaded. I put a new copy in there for you and you should be cooking with gas now... |
|
Back to top |
|
|
qureus Guest
|
Posted: Tue Feb 15, 2005 11:54 am Post subject: You're the best! |
|
|
Thanks, John! I 'preciate it! |
|
Back to top |
|
|
Roaring Tiger Guest
|
Posted: Wed Mar 09, 2005 7:36 pm Post subject: now having problems with opening link in Big Cat Chronicles |
|
|
Hi John,
I went through the same process of you outlined in the above posts and am having the same problem with xhtml-target.js and opening separate windows that I had with Intuiosity.
I'm thinking it's a Dreamweaver highjack. I've got the app loaded on my PC. Even though I tried to save the file in Notepad, through mysterious technical magic, the file is saved as a JScript Script file (and it shows a little Dreamweaver file icon).
Can you please advise on how to fix the file so I can open separate windows on Big Cat Chronicles too?
Thanks!
RT |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Wed Mar 09, 2005 8:30 pm Post subject: Re: now having problems with opening link in Big Cat Chronic |
|
|
Not sure what your problem was, but I uploaded a copy of the file for you and it is working properly. How did you upload the file, with Dreamweaver or via our web interface in the File Manager? |
|
Back to top |
|
|
Search all BlogHarbor support resources.
|
View previous topic :: View next topic |
|