Thursday, 28 April 2011

Blog Tips: How to link Pages Tabs to other pages instead of static pages

This post is taken directly from this website.

An easy way to add navigation tabs in Blogger is using a Pages gadget. However, as the name implies, there is a shortcoming -the tabs only link to static pages.
Does that mean you should forget about adding tabs linking pages other than static pages? No, definitely not….because there is always a workaround.
Use the hack below to add tabs that link to any URLs. You can add tabs linking to label pages,  individual post pages, website or whatever.
Here’s how:
  1. Go to Dashboard > Design > Edit HTML.
  2. Tick the Expand Widget Templates check box on top right of the HTML window.
  3. Look for Pages gadget code, like this:
    01<b:widget id='PageList1' locked='false' title='Pages' type='PageList'>
    02<b:includable id='main'>
    03  <b:if cond='data:title'><h2><data:title/>h2>b:if>
    04  <div class='widget-content'>
    05    <ul>
    06      <b:loop values='data:links' var='link'>
    07        <b:if cond='data:link.isCurrentPage'>
    08          <li class='selected'><a expr:href='data:link.href'><data:link.title/>a>li>
    09        <b:else/>
    10          <li><a expr:href='data:link.href'><data:link.title/>a>li>
    11        b:if>
    12      b:loop>
    13     PUT THE CODE FOR THE LINKS HERE
    14    ul>
    15    <b:include name='quickedit'/>
    16  div>
    17b:includable>
    18b:widget>
  4. Put the code for the  additional links right after as indicated in line 13.
    Each link shall be in this format:
    <li><a href="YourLink">YourLinkTexta>li>
    where YourLink is an URL and YourLinkText is the text you would like to appear on the tab.
    To make the link open in a new window or tab, add target="_blank" attribute right after href="YourLink".
  5. Preview before saving.
  6. Enjoy!

No comments:

Post a Comment