July 15, 2008

How to make external links in linklist widget open in a new window ?

Do you have exchange links with your friend's blog? I'm sure that some of us have a blogroll in sidebar. So how to make these links open in new windows? Follow these steps:

Step 1: Sign in your Blogger account, click Layout tab | Edit HTML, check Expand Widget Templates, scroll down and find your link list. You may also can find it by searching LinkList keyword.





Step 2: Now you put the colored code in this way and save your template:

<b:widget id='LinkList1' locked='false' title='Other blogs' type='LinkList'>
<b:includable id='main'>

<b:if cond='data:title'><h2><data:title/></h2></b:if>
<div class='widget-content'>
<ul>
<b:loop values='data:links' var='link'>
<li><a expr:href='data:link.target' target='_blank'><data:link.name/></a></li>
</b:loop>
</ul>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>


In the case of external links in posts, you could view this tip.

18 comments:

  1. he..he.. this tip is used for classic template only, isn't it? You can use link list by opening a page element in Layout to add links without editing your template.
    ReplyDelete
  2. @Thang, this tip is used for new blogger template. It makes an external link open in a new window only, having no affect on your link list data added in Layout.
    ReplyDelete
  3. @lauren, this tip works right. Try again!
    ReplyDelete
  4. Thanks this works well. If you want only 1 new window for all links to open in, you can set target='new'
    ReplyDelete
  5. OK. How do you make a double underline under id? I've tried it without the double underline and it doesn't work, so it must need one.
    ReplyDelete
  6. Great! this thing really works! Thank you very much!
    ReplyDelete
  7. What am I doing wrong? I tried it and I get this error message:

    Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
    XML error message: Element type "a" must be followed by either attribute specifications, ">" or "/>".
    ReplyDelete
  8. Ok, I just realized my mistake. It is CRUCIAL that you include the space before target='_blank'
    ReplyDelete
  9. Works beautifully. So simple, yet so overlooked (on my part). You rock!
    ReplyDelete
  10. Is there any way to make this work just for post/body links... I only want my blog posts to do this seeing I have so many external links.
    ReplyDelete
  11. Exactly the information I was looking for. I allays open external sites in new windows.

    I have a non related question.

    How did you achieve Google internet presence? I see you ranked high in Google for this. How long has this website been around?

    You can contact me on my website.

    thank you, helpful information

    Daniel James
    ReplyDelete
  12. Thanks a lot it is a good guide, now to make external links in linklist widget open in a new win? is simple utilizing your tips. Thanks
    ReplyDelete
  13. Instructions like that are helpful, now to make external links in linklist widget open in a new win? is an simple task utilizing your suggestions. Thank you
    ReplyDelete