2008-05-10

Blogging Tip : Label links open in new window

With the target attribute, it tells the browser to open the link in a new browser window. For example:-
<a href="http://www.servimg.com/image_preview.php?i=309&u=11949173" target="_blank" ><img src="http://i44.servimg.com/u/f44/11/94/91/73/th/38644510.jpg" border="0" alt="Image hosted by servimg.com" /></a>

This article demonstrates how to link to another page by opening a new window, so that the visitor does not have to leave your Web site.

1- Go to Dashboard > Layout> Edit Html
2- Tick on Expand Widget Templates box
3- Search for these lines:-
<b:widget id='Label1' locked='false' title='Labels' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content'>
<ul>
<b:loop values='data:labels' var='label'>
<li>
<b:if cond='data:blog.url == data:label.url'>
<data:label.name/>
<b:else/>
<a expr:href='data:label.url' target='_blank'><data:label.name/></a>
</b:if>
(<data:label.count/>)
</li>
</b:loop>


4- Add the line in blue color to the code as shown above.
target='_blank'

5- Save the template.

0 comments:

Post a Comment

1. Comments posted must be accompanied by names or pseudonyms.
2. Anonymous posting and those containing profanities will be rejected.
3. Comments are moderated due to spam problems. I have to approve the comment before it will show up.

:)) ;)) ;;) :D ;) :p :(( :) :( :X
=(( :-o :-/ :-* :| 8-} :)] :-t b-( :-L