Targeting Text Links

Do you want to target text to a frame in a frames site? There is an answer!

The problem for Web Studio users has been that adding a target to text was impossible with the program unless writing the code yourself. There is an easy way to do this if all links on the page will be opened in the same target. There is also a way to do it with selected text links too. The methods are vastly different, but the fact is you can have targeted text links in Web Studio!

If ALL the text links on your page will be opening in the same frame you can simply make your pages as normal and apply the links to the text as you normally would. To target those links you just created, put the following code in the header of the links page -

<base target="HERE">

Change HERE to the FRAME NAME where you want the pages to open. If all the links will be opening in new browser windows, just use "first_window" instead. It's that simple!

Now here's where things get a little more diffcult. If you have text links on a page that you want to open in a specific frame (or new window) and have other text links on that same page that you want opened somewhere else, you'll need to do things a bit differently. First, you need to know the name of the page you want opened with the link, and you need to know the target frame name. Here is how it's done.

The main problem is that you can't enter "pagename.html" in the "My Links" gallery. Regular links entered in "My Links" must begin with http://. Secondly, unlike adding links to images, you can't put a target in "My Links" - like http://anything.com/anything.html" target="C. The "My Links" gallery will not recognize links that do not begin with http:// and it will also not recognize a target extension. But it WILL accept and recognize links that begin with javascript. Here's where the fun begins!

Let's say the page you want to link is called "Party", and the target you want it to open in is "content". Here is the link to add into the "My Links" gallery -

javascript:parent.content.location.href='Party'.html

Not so simple? Actually, it is! Just change "content" to whatever you've named the frame where the page will open (refer to your frameset code) and change "Party" to whatever your page name is. The link needs to be written as "html" at the end so it will work on the net, but this will not work in preview. For that you must use "htm". If you want to add a link using "htm" for testing purposes go right ahead - you can always add the correct link once you get familiar with it.

Now, if you want to open a new browser window, the link will be a little different. For those instructions, please visit the New Windows page.

There, now that's not so hard, is it? Remember, in Web Studio version 2 you can add links and edit them easily, so it will not hurt anything to experiment!

Give it a try on a test site!

~ swipesy ~