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:
- Go to Dashboard > Design > Edit HTML.
- Tick the Expand Widget Templates check box on top right of the HTML window.
- 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
>
17
b:includable
>
18
b:widget
>
- Put the code for the additional links right after
as indicated in line 13.
Each link shall be in this format:
where<
li
><
a
href
=
"YourLink"
>YourLinkText
a
>
li
>
YourLink
is an URL andYourLinkText
is the text you would like to appear on the tab.
To make the link open in a new window or tab, addtarget="_blank"
attribute right afterhref="YourLink"
.
- Preview before saving.
- Enjoy!
No comments:
Post a Comment