BlogHarbor Home Page
FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  UsergroupsRSS   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Links in seperate windows
 
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> Beginner's Lounge
View previous topic :: View next topic  
Author Message
alanmarx



Joined: 21 Jul 2004
Posts: 1

PostPosted: Wed Jul 21, 2004 9:01 pm    Post subject: Links in seperate windows Reply with quote

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
View user's profile Send private message Visit poster's website
john
Site Admin


Joined: 16 Mar 2004
Posts: 3434

PostPosted: Wed Jul 21, 2004 10:01 pm    Post subject: Re: Links in seperate windows Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vtmnldy
Guest





PostPosted: Tue Oct 05, 2004 11:29 am    Post subject: Missing Link Reply with quote

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

PostPosted: Tue Oct 05, 2004 11:51 am    Post subject: Re: Missing Link Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
qureus
Guest





PostPosted: Tue Feb 15, 2005 12:04 am    Post subject: can you tell me what I did wrong Reply with quote

Hi John,

I tried to set this up and have done something wrong. The first post I tried to have with auto-open new windows is this one....

http://intuiosity.blogharbor.com/blog/_archives/2005/2/14/324822.html

Can you tell me what I did wrong?

Thanks!
Q
Back to top
john
Site Admin


Joined: 16 Mar 2004
Posts: 3434

PostPosted: Tue Feb 15, 2005 12:20 am    Post subject: Re: can you tell me what I did wrong Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
qureus
Guest





PostPosted: Tue Feb 15, 2005 11:54 am    Post subject: You're the best! Reply with quote

Thanks, John! I 'preciate it!
Back to top
Roaring Tiger
Guest





PostPosted: Wed Mar 09, 2005 7:36 pm    Post subject: now having problems with opening link in Big Cat Chronicles Reply with quote

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

PostPosted: Wed Mar 09, 2005 8:30 pm    Post subject: Re: now having problems with opening link in Big Cat Chronic Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Search all BlogHarbor support resources.
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> Beginner's Lounge All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum