Adding non-static page tabs to pages/PageList gadget
Update Sep. 2011: Blogger now has the ability to add web links to pages gadget, as such the original hack is no longer necessary.
With the new Blogger UI (user interface), you can add any web links (external links, label URLs, individual post links etc.) to the pages gadget. Here’s how:
- Switch to the new interface by clicking the “Try the updated Blogger interface” link at the top of the screen (you can always return to old interface at any time).
- Go to Dashboard and click the grey dropdown menu next to the blog you want to add the link to.
- Select Pages.
- Click New Page dropdown and select Web Address.
- Enter the tab/page title and the URL in the respective text field.
- Save by clicking Save Arrangement button.
Below is the original tutorial (for reference)
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
INSERT 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
</b:loop>
as indicated in line 13.
Each link shall be in this format:<
li
><
a
href
=
"YourLink"
>YourLinkText</
a
></
li
>
whereYourLink
is an URL andYourLinkText
is the text you would like to appear on the menu or tab. - Preview before saving.
- Enjoy!
No comments :