How To Open PageList Widget Links in New Window

Posted by Lasantha Bandara on February 5th, 2014 File Under : html, widget0 Comment

This quick tutorial explains how to open each link of your Blogger PageList widget in new window or new tab.

1. First Login to your Blogger account and go to "Template"--> "Edit HTML" of your blog.

2. Now find your PageList widget code. (Note : You may also can find it by searching <b:widget id='PageList)

Your PageList widget code will more similar to this. But widget id (PageList1) can be different :

<b:widget id='PageList1' locked='false' title='Pages' type='PageList'>
  <b:includable id='main'>
  <b:if cond='data:title'><h2><data:title/></h2></b:if>
  <div class='widget-content'>
    <b:if cond='data:mobile'>
      <select expr:id='data:widget.instanceId + &quot;_select&quot;'>
        <b:loop values='data:links' var='link'>
          <b:if cond='data:link.isCurrentPage'>
            <option expr:value='data:link.href' selected='selected'><data:link.title/></option>
          <b:else/>
            <option expr:value='data:link.href'><data:link.title/></option>
          </b:if>
        </b:loop>
      </select>
      <span class='pagelist-arrow'>&amp;#9660;</span>

    <b:else/>
      <ul>
        <b:loop values='data:links' var='link'>
          <b:if cond='data:link.isCurrentPage'>
            <li class='selected'><a expr:href='data:link.href'><data:link.title/></a></li>
          <b:else/>
            <li><a expr:href='data:link.href'><data:link.title/></a></li>
          </b:if>
        </b:loop>
      </ul>
    </b:if>
    <b:include name='quickedit'/>
  </div>
  </b:includable>
</b:widget>

3. Now put blue colored code ( target='_blank' ) as the example below into your Link list code.

<b:widget id='PageList1' locked='false' title='Pages' type='PageList'>
  <b:includable id='main'>
  <b:if cond='data:title'><h2><data:title/></h2></b:if>
  <div class='widget-content'>
    <b:if cond='data:mobile'>
      <select expr:id='data:widget.instanceId + &quot;_select&quot;'>
        <b:loop values='data:links' var='link'>
          <b:if cond='data:link.isCurrentPage'>
            <option expr:value='data:link.href' selected='selected'><data:link.title/></option>
          <b:else/>
            <option expr:value='data:link.href'><data:link.title/></option>
          </b:if>
        </b:loop>
      </select>
      <span class='pagelist-arrow'>&amp;#9660;</span>

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

Important : You must include a space before target='_blank' as the example above.

Now save your template and you are done.

File Under : html, widget

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.