template tags: defined
blogger tags look a lot like html. one difference between them and html is that case is
important.
blogger tags, defined:
<$blogsitefeedlink$> - outputs your site feed's url inside a <link> tag:
<link rel="[Link]" type="application/atom+xml" title="your
blog's title" href="[Link] />
<$blogencoding$> - inserts the encoding setting from the settings | formatting tab into
a content-type declaration. specifically:
<meta http-equiv="content-type"
content="text/html; charset=<$blogencoding$>" />
<blogsitefeed><$blogsitefeedurl$></blogsitefeed> - allow the rss feed for your
blog to be auto-discovered by supporting aggregators. example:
<blogsitefeed>
<link rel="alternate"
type="application/rss+xml"
title="rss"
href="<$blogsitefeedurl$>" />
</blogsitefeed>
<$blogmetadata$> - inserts all blog metadata via one tag. here's sample output:
<meta http-equiv="content-type"
content="text/html; charset=utf-8" />
<meta name="mssmarttagspreventparsing"
content="true" />
<meta name="generator" content="blogger" />
<link rel="[Link]" type="application/atom+xml"
title="danotestmule"
href="[Link] />
<link rel="[Link]" type="application/atom+xml"
title="danotestmule"
href="[Link] />
<link rel="edituri" type="application/rsd+xml"
title="rsd"
href="[Link] />
<meta name="robots" content="noindex,nofollow" />
(this last tag will appear if your blog is set to unlisted.)
<$blogpagetitle$> - gives your published blog pages smart titles ("blog name" for the
index page, "blog name: date info" for archive pages, and "blog name: post title" for post
pages). this tag should only be used in a template's <head>, in between <title> and
</title>.
<$blogtitle$> - the title of the blog.
<$blogdescription$> - a description of the blog.
<blogger> & </blogger> - the main "container tags" for your blog content; most of the
following tags should be inside these to work properly.
<blogdateheader>
<$blogdateheaderdate$>
</blogdateheader> - these output date headers for each post, as defined in the settings |
formatting tab.
<blogitemtitle>
<blogitemurl>
<a href="<$blogitemurl$>">
</blogitemurl>
<$blogitemtitle$></a>
</blogitemtitle> - these output each post's title, linked to their respective external urls;
remove the second, third and fourth lines to unlink the titles.
<$blogitembody$> - the content of a post.
<$blogitemauthor$> - the author of a post, using both the first and last names.
<$blogitemauthornickname$> - the display name of the author of a post.
<$blogitemauthoremail$> - the email address of the author of a post.
<$blogitemauthorurl$> - the homepage url of the author of a post.
<$blogitemdatetime$> - the date and/or time of a post.
<$blogitemnumber$> - the unique id number of the post.
<$blogitemarchivefilename$> - the archive filename of the post
<$blogitempermalinkurl$> - the permalink of the post
<$blogitemcontrol$> - the quick edit link of the post
<blogdatefooter>
</blogdatefooter> - these output date footers for each post, as defined in the settings |
formatting tab.
sidebar archive list tags, explained in the archive links article:
<bloggerarchives>
<a href='<$blogarchiveurl$>'><$blogarchivename$></a>
</bloggerarchives>
conditional tags, explained in the conditional tag article:
<mainpage></mainpage>
<archivepage></archivepage>
<itempage></itempage>
<mainorarchivepage></mainorarchivepage>
previous post code, explained in the previous posts article.
<bloggerpreviousitems>
<a href="<$blogitempermalinkurl$>">
<$blogpreviousitemtitle$>
</a><br />
</bloggerpreviousitems>
comment code, explained in the comment tags article.
<blogitemcommentsenabled>
<$blogitemcommentcount$>
<$blogitemcommentcreate$>
<$blogitemcommentformonclick$>
<blogitemcomments>
<a name="<$blogcommentnumber$>"></a>
<$blogcommentbody$>
<$blogcommentpermalinkurl$>
<$blogcommentauthor$>
<$blogcommentdatetime$>
<$blogcommentdeleteicon$>
<$blogitemcreate$>
</blogitemcomments>
</blogitemcommentsenabled>
profile code, explained further in the profile tags article:
<$blogownernickname$>
<$blogownerfirstname$>
<$blogownerlastname$>
<$blogownerfullname$>
<$blogowneremail$>
<$blogownerlocation$>
<$blogowneraboutme$>
<$blogownerphotourl$>
<$blogownerprofileurl$>
template walkthrough
a lot of our other articles explain the various blogger template tags in great detail, but this
one is going to be a demonstration of how they all work together to create a complete
template. as we walk through the code, i'll explain what is going on in each section. the
blogger tags will all be highlighted, apart from the regular html and css, so they'll be easy
to spot. here we go!
<html><head><title><$blogpagetitle$></title>
this is the beginning of our template. you'll usually want to use the <$blogpagetitle$> for
your title, since it automatically uses the right name for any page you're on.
<style>
/* style modified from glish:
[Link] */
body{margin:0px 0px 0px 0px;font-family:trebuchet
ms, verdana, sans-serif; background-color:white;}
#title{font-size:63px; padding-left:15px;
padding-top:10px; text-transform:uppercase;
font-family:trebuchet ms, verdana, sans-serif;}
#title a {text-decoration:none; color:inherit;}
#description{padding:0px; padding-top:10px;
font-size:12px; font-weight:normal}
.dateheader{border-bottom:none; font-size:15px;
text-align:left;
margin-top:20px; margin-bottom:14px; padding:1px;
padding-left:17px; color:gray;
font-family:trebuchet ms, verdana, sans-serif;}
.posttitle{font-size:18px; font-weight:bold}
.post{padding-left:20px; margin-bottom:20px;
text-indent:10px;
padding-right:20px; line-height:22px}
.postfooter{margin-bottom:15px; margin-left:0px;
color:black; font-size:10px}
#leftcontent{background-color:whitesmoke;
border-right:2px dashed #000;
border-bottom:0px dashed #000; float:left;
padding-bottom:20px;
margin-right:15px; padding:0px; width:67%;
border-top:0px dashed #000}
.sidebartitle{font-weight:bold; font-size:18px}
h1{font-size:14px; padding-top:10px}
a{text-decoration:none}
a:hover{border-bottom:dashed 1px red}
#rightcontent{font-size:12px; height:100%;
margin-left:0px; text-transform:none;
padding-right:10px; background-color:white;}
.blogcomments{font-size:15px; text-align:left;
margin-top:20px; margin-bottom:14px; padding:1px;
padding-left:17px; color:gray; font-family:trebuchet
ms, verdana, sans-serif;}
.blogcomment{margin-top:10px; margin-bottom:10px;
color:black; text-indent:10px; padding-right:20px;
line-height:22px}
.deleted-comment {font-style:italic; color:gray;}
.byline{margin-bottom:20px; margin-left:0px;
margin-right:10px; color:black;
font-size:10px; display:inline}
#profile-container { }
.profile-datablock { }
.profile-img {display:inline;}
.profile-img img {float:left; margin:0 10px 0px 0;
border:4px solid #ccc;}
#profile-container p { }
#profile-container .profile-textblock { }
.profile-data strong {display:block;}
</style>
this section is the style sheet, which describes the colors, fonts, borders and other
properties of everything on your page. for more information, see how do i change the
colors or fonts in my template? and what else can i do with css?
<!-- meta information -->
<$blogmetadata$>
</head>
at the end of the head section, we have the <$blogmetadata$> tag. this is immensely
useful, since it automatically inserts all the meta tags that you need for your blog in one
easy step.
now we're ready to get into the body of the template. this is the part that we actually see
in the browser window when we view the blog.
<body>
<div id="leftcontent">
<div id="title">
<itempage><a href="<$blogurl$>"></itempage>
<$blogtitle$>
<itempage></a></itempage>
</div>
the <$blogtitle$> tag is the part that shows the title of our blog, but we added a little bit
of extra code around it to make a link back to the homepage. the <$blogurl$> tag is the
one that gives us that address. however, since we don't want to bother linking back to the
homepage if we're already on it, we wrapped the link in <itempage> tags, so it will only
be there on item pages.
now, on to the posts:
<blogger>
<blogdateheader>
<div class="dateheader"><$blogdateheaderdate$></div>
</blogdateheader>
<div class="post">
<a name="<$blogitemnumber$>"> </a>
<blogitemtitle><span class="posttitle">
<blogitemurl><a href="<$blogitemurl$>"></blogitemurl>
<$blogitemtitle$></a></span></blogitemtitle>
<$blogitembody$>
<span class="postfooter">
¶ <a href="<$blogitempermalinkurl$>"
title="permanent link"> <$blogitemdatetime$></a>
<mainorarchivepage><blogitemcommentsenabled>
<a href="<$blogitemcommentcreate$>"
<$blogitemcommentformonclick$>>
<$blogitemcommentcount$> comments</a>
</blogitemcommentsenabled></mainorarchivepage>
</span>
</div>
notice the <blogger> tag at the beginning of this section. pretty soon we'll come upon a
matching </blogger> tag. anything between those two tags will be repeated for every post
on your page.
the tags with dollar signs ($) in this section all refer to data that will be different for each
individual post. for instance, <$blogitemtitle$> prints the title, and <$blogitembody$>
prints the entire text of the post.
the tags without dollar signs indicate when something should be printed in the page or
not. for instance <blogitemtitle> and
</blogitemtitle> enclose code and text that will only appear if the item has a title.
similarly text between <mainorarchivepage> and </mainorarchivepage> will only appear
on the main page or on archive pages. we're using that tag to enclose the comment links,
since we don't need to show those on the item pages.
speaking of comments, we'll need some code to display comments for entries that have
them, so we'll see that next. note that we're still within the <blogger> tags, since
comments relate to individual posts.
<itempage>
<div class="blogcomments">
<blogitemcommentsenabled><a name="comments"></a>
comments:
<blogitemcomments>
<div class="blogcomment">
<a name="<$blogcommentnumber$>"></a>
<$blogcommentbody$><br />
<div class="byline">
<a href="<$blogcommentpermalinkurl$>"
title="permanent link">#</a>
posted by <$blogcommentauthor$> :
<$blogcommentdatetime$>
</div>
<$blogcommentdeleteicon$>
</div>
</blogitemcomments>
<$blogitemcreate$>
</div>
</blogitemcommentsenabled>
<br /> <br />
<a href="<$blogurl$>"><< home</a>
</div>
</itempage>
</blogger>
</div>
we've got <itempage> and <blogitemcommentsenabled> tags in here so that this code
only appears on the post pages for entries that allow comments. the <blogitemcomments>
and </blogitemcomments> tags are similar to <blogger>, since they contain the code that
will be repeated for every comment on the page. inside those tags, you can see that
displaying comments is pretty much like displaying posts. there is
<$blogcommentbody$> for the text of the comment, etc.
a couple other tags work slightly differently. <$blogcommentdeleteicon$> automatically
inserts a delete icon and link for each comment. <$blogitemcreate$> adds in the link to
add a new comment. for further details on all the comment tags, you can read this article.
so that covers everything in the main section of your template. let's take a look at the
sidebar now.
<div id="rightcontent">
<div id="description"><$blogdescription$></div>
the <$blogdescription$> tag is similar to the <$blogtitle$> tag we saw earlier. it will
display the description for your blog.
<p>
<div id="profile-container">
<div class="sidebartitle">about me</div>
<dl class="profile-datablock">
<dt class="profile-img">
<img src="<$blogownerphotourl$>"
width="68" alt="" />
</dt>
<dd class="profile-data"><strong>name:</strong>
<$blogownernickname$></dd>
<dd class="profile-data"><strong>location:</strong>
<$blogownerlocation$></dd>
</dl>
<p class="profile-textblock">
<$blogowneraboutme$>
</p>
<p class="profile-link">
<a href="<$blogownerprofileurl$>">view my profile</a>
</p>
</div>
this section contains your profile information, including a link to the page with your
complete profile. these all have pretty descriptive names, like <$blogownernickname$>,
so you can tell what information they'll print out.
another common thing to have in your sidebar is a list of all your archive links.
<div class="sidebartitle">archives</div>
<bloggerarchives>
<a href="<$blogarchiveurl$>"><$blogarchivename$></a>
</bloggerarchives>
<br /></p>
the <bloggerarchives> tags are some more of the repeating kind. they will print the line
of code between them for each of your archive files.
if there's anything else you want in your sidebar (other links, more text, etc.) you can add
that in here. you can copy the formatting for the archives title if you want to make more
matching headers.
then, of course, at the end of the template, we have our ubiquitous powered by blogger
button:
<br />
<p style="text-align:center">
<a href="[Link]
<img alt="powered by blogger" border="0"
src="[Link]
</a>
</p>
</div>
</body>
</html>
and that's the end of our template. if you want to use this template or modify it, you can
find listed with our other templates as "tekka."
template tag list
here is a list of all of blogger's template tags, for the purpose of copying and pasting
when template hacking. these tags are explained further in blogger template tags, defined.
<head> tags:
<$blogsitefeedlink$>
<$blogencoding$>
<blogsitefeed>
<$blogsitefeedurl$>
</blogsitefeed>
<$blogmetadata$>
<$blogpagetitle$>
<body> tags:
<$blogownerfirstname$>
<$blogownerlastname$>
<$blogowneremail$>
<$blogownerfullname$>
<$blogownerphotourl$>
<$blogownernickname$>
<$blogownerlocation$>
<$blogowneraboutme$>
<$blogownerprofileurl$>
<blogger>
<blogdateheader>
<$blogdateheaderdate$>
</blogdateheader>
<blogitemtitle>
<blogitemurl>
<a href="<$blogitemurl$>">
</blogitemurl>
<$blogitemtitle$></a>
</blogitemtitle>
<blogitemtitle>
<$blogitemtitle$>
</blogitemtitle>
<$blogitembody$>
<$blogitemauthor$>
<$blogitemauthornickname$>
<$blogitemauthoremail$>
<$blogitemauthorurl$>
<$blogitemdatetime$>
<$blogitemnumber$>
<$blogitemarchivefilename$>
<$blogitempermalinkurl$>
<$blogitemcontrol$>
<blogdatefooter>
</blogdatefooter>
</blogger>
<bloggerarchives>
<a href='<$blogarchiveurl$>'><$blogarchivename$></a>
</bloggerarchives>
<mainpage></mainpage>
<archivepage></archivepage>
<itempage></itempage>
<mainorarchivepage></mainorarchivepage>
<bloggerpreviousitems>
<a href="<$blogitempermalinkurl$>">
<$blogpreviousitemtitle$>
</a><br />
</bloggerpreviousitems>
<blogitemcommentsenabled>
<$blogitemcommentcount$>
<$blogitemcommentcreate$>
<$blogitemcommentformonclick$>
<blogitemcomments>
<a name="<$blogcommentnumber$>"></a>
<$blogcommentbody$>
<$blogcommentpermalinkurl$>
<$blogcommentauthor$>
<$blogcommentdatetime$>
<$blogcommentdeleteicon$>
<$blogitemcreate$>
</blogitemcomments>
</blogitemcommentsenabled>
what do blogger's template tags do?
blogger makes web updates easy. at a minimum, all you have to do is write a post and
click "publish" to see your page updated. when you submit a post to blogger, it gets saved
to our database and this is where blogger tags come in. blogger tags tell our blog
publishing program which information to fetch from database and put on the page.
"please put the title here, the post right underneath, and then the date and time go here
and here. thank you." it's all very polite.
blogger tags are meant to look like html so that when a more advanced user wants to
customize a template, they will be in familiar territory. there are many different blogger
tags but they can be generally categorized into two main groups: item-level tags and
page-level tags.
the item-level tags do all the grunt work because they are the ones that pull the actual
information from blogger's database and put it on the web. they do all the heavy lifting
but don't worry, we taught them to bend at the knees. you can spot an item level tag in the
wild because they are the ones with the money signs such as <$blogitemauthor$> (that
tag will make the blog author's name show up.)
the page-level tags think they're fancier than all the others (but they're really not) because
they have more to do with the design and structure of a page. page level tags tell item
level tags when and where to do their thing so when you take a look, you'll see them
appearing both before and after item level tags.
<bloggerarchives>
<$blogarchiveurl$>
<$blogarchivename$>
</bloggerarchives>
see how the blogger archives tag tells those two money sign tags that they can go ahead
and do their thing? so bossy! but they actually get along very well so we can't complain.
both tags also get along well with html. web designer types who like to design their own
blogger templates (or modify our free templates) understand that they can wrap html
around our tags to get them to look however they want.
<blogdateheader>
<h4><$blogdateheaderdate$></h4>
</blogdateheader>
in the example above, the date headers on each blog post will show up larger and bolder
than other text on the web page because the user has wrapped the <h4></h4> tags (a kind
of tag in html that means "bigger and bolder") around the <$blogdateheaderdate$> tag.
that's a little taste of what it's like to fiddle around with blogger tags and html. remember,
you don't have to work with your template code if you don't want to; that's why we have
tons of free designs for you to choose from. however, just in case you want to try your
hand at working on your template we've got other tutorials for you to read. if you do start
tinkering, here's a tip: copy and paste the code that's in your template section first and
save it as a text file so if you really screw everything up you can just revert to what you
started with. have fun!
comments tags
there are two sections of comment tags in a template. one section simply creates the links
that readers see next to your posts and click on to leave you a comment. the other section
displays the comments themselves. we'll look at these two parts separately.
these examples show only a minimal amount of code to make the comments work. you
are, of course, welcome to add any formatting that you like to it, so that it matches the
rest of your blog.
links:
the following piece of code will print a link reading "x comments" where "x" is the
number of comments that have been left on that post so far. it should be placed between
the <blogger> and </blogger> tags that display your posts, and it usually goes in the
byline, where the author's name is listed.
<blogitemcommentsenabled>
<a href="<$blogitemcommentcreate$>"
<$blogitemcommentformonclick$>>
<$blogitemcommentcount$> comments</a>
</blogitemcommentsenabled>
first, notice the <blogitemcommentsenabled> tags that surround the others. this is so the
rest of the code will only be displayed on posts for which comments are enabled. the link
to <$blogitemcommentcreate$> will point to the page where you can both read existing
comments and create a new one. <$blogitemcommentformonclick$> includes the code
that opens the link in a popup window, if you have that option selected. note that it goes
inside the opening <a> tag. finally, <$blogitemcommentcount$> simply prints out the
number of comments for that post. you can put whatever text you like in place of
"comments."
comments:
this part of the code will also go between the <blogger> and </blogger> tags, but you
will probably also want to enclose them in <itempage> and </itempage> tags as well, so
the comments only appear on your post pages, and don't clutter up the main page of your
blog.
<blogitemcommentsenabled>
<a name="comments"></a>
<h4><$blogitemcommentcount$> comments:</h4>
<blogitemcomments>
<a name="<$blogcommentnumber$>"></a>
<p class="comment-body">
<$blogcommentbody$>
</p>
<p class="comment-data">
by <$blogcommentauthor$>, at
<a href="#<$blogcommentnumber$>">
<$blogcommentdatetime$></a>
<$blogcommentdeleteicon$>
</p>
</blogitemcomments>
<p><a href="<$blogitemcommentcreate$>"
<$blogitemcommentformonclick$>>
post a comment</a></p>
</blogitemcommentsenabled>
here we see a few tags that tie in to the previous bit of code. once again, we've enclosed
everything in <blogitemcommentsenabled> so posts that don't allow comments won't
print anything. we also have <$blogitemcommentcount$> as before, to display the
number of comments.
the <blogitemcomments> tags mark the section of code that cycles through each
comment to print it out. the <$blogcommentbody$>, <$blogcommentauthor$> and
<$blogcommentdatetime$> tags all print out the information you would expect them to,
with the added benefit that the author tag includes a link to the author's profile or
webpage, if they have one. the <$blogcommentnumber$> gives the id number of each
comment, for creating permalinks, just like the id numbers of regular posts.
finally, there are a couple little tags to round out the functionality.
<$blogcommentdeleteicon$> inserts a delete button for each comment, but only if the
person viewing it is the comment author or an administrator of the blog. no one else is
allowed to delete comments. <$blogitemcreate$> adds the link that lets people leave
new comments.
comments tags
there are two sections of comment tags in a template. one section simply creates the links
that readers see next to your posts and click on to leave you a comment. the other section
displays the comments themselves. we'll look at these two parts separately.
these examples show only a minimal amount of code to make the comments work. you
are, of course, welcome to add any formatting that you like to it, so that it matches the
rest of your blog.
links:
the following piece of code will print a link reading "x comments" where "x" is the
number of comments that have been left on that post so far. it should be placed between
the <blogger> and </blogger> tags that display your posts, and it usually goes in the
byline, where the author's name is listed.
<blogitemcommentsenabled>
<a href="<$blogitemcommentcreate$>"
<$blogitemcommentformonclick$>>
<$blogitemcommentcount$> comments</a>
</blogitemcommentsenabled>
first, notice the <blogitemcommentsenabled> tags that surround the others. this is so the
rest of the code will only be displayed on posts for which comments are enabled. the link
to <$blogitemcommentcreate$> will point to the page where you can both read existing
comments and create a new one. <$blogitemcommentformonclick$> includes the code
that opens the link in a popup window, if you have that option selected. note that it goes
inside the opening <a> tag. finally, <$blogitemcommentcount$> simply prints out the
number of comments for that post. you can put whatever text you like in place of
"comments."
comments:
this part of the code will also go between the <blogger> and </blogger> tags, but you
will probably also want to enclose them in <itempage> and </itempage> tags as well, so
the comments only appear on your post pages, and don't clutter up the main page of your
blog.
<blogitemcommentsenabled>
<a name="comments"></a>
<h4><$blogitemcommentcount$> comments:</h4>
<blogitemcomments>
<a name="<$blogcommentnumber$>"></a>
<p class="comment-body">
<$blogcommentbody$>
</p>
<p class="comment-data">
by <$blogcommentauthor$>, at
<a href="#<$blogcommentnumber$>">
<$blogcommentdatetime$></a>
<$blogcommentdeleteicon$>
</p>
</blogitemcomments>
<p><a href="<$blogitemcommentcreate$>"
<$blogitemcommentformonclick$>>
post a comment</a></p>
</blogitemcommentsenabled>
here we see a few tags that tie in to the previous bit of code. once again, we've enclosed
everything in <blogitemcommentsenabled> so posts that don't allow comments won't
print anything. we also have <$blogitemcommentcount$> as before, to display the
number of comments.
the <blogitemcomments> tags mark the section of code that cycles through each
comment to print it out. the <$blogcommentbody$>, <$blogcommentauthor$> and
<$blogcommentdatetime$> tags all print out the information you would expect them to,
with the added benefit that the author tag includes a link to the author's profile or
webpage, if they have one. the <$blogcommentnumber$> gives the id number of each
comment, for creating permalinks, just like the id numbers of regular posts.
finally, there are a couple little tags to round out the functionality.
<$blogcommentdeleteicon$> inserts a delete button for each comment, but only if the
person viewing it is the comment author or an administrator of the blog. no one else is
allowed to delete comments. <$blogitemcreate$> adds the link that lets people leave
new comments.
profile tags
there are a number of tags you can use to display information from your profile in your
blog. here's a quick list:
• <$blogmemberprofile$> - "smart" tag that intelligently incorporates
functionality for all of the below tags. meaning, info that isn't in your profile (or
isn't shared) won't be displayed on your blog. if used on a team blog, it will render
a list of links to member profiles.
• <$blogownernickname$> - your nickname.
• <$blogownerfirstname$> - your first name.
• <$blogownerlastname$> - your last name.
• <$blogownerfullname$> - your first and last name.
• <$blogowneremail$> - your email address.
• <$blogownerlocation$> - your city, state and/or country.
• <$blogowneraboutme$> - your "about me" text.
• <$blogownerphotourl$> - the url of your profile photo.
• <$blogownerprofileurl$> - the url of your complete profile.
example:
here's a simple example of how you might use a few of these together in your template:
<p>
<img src="<$blogownerphotourl$>"><br />
<strong>name:</strong> <$blogownerfullname$><br />
<strong>home:</strong> <$blogownerlocation$><br />
<strong>about me:</strong> <$blogowneraboutme$><br />
<a href="<$blogownerprofileurl$>">see my complete profile</a>
</p>
here's what it might look like, once you publish your blog:
name: joe blogger
home: mountain view : california : united states
about me: i'm an imaginary person, simply a profile example in a blogger help
article. it gets lonely sometimes, being non-existent, but one gets used to it after a
while.
see my complete profile
what are conditional tags?
conditional tags are blogger template tags that provide greater flexibility. we call them
conditional tags because they allow you to specify template changes that only occur
under certain conditions. here's how they work: you still keep your blog template code in
one spot, but you wrap these conditional tags around the stuff you want to show or hide
depending on the page.
<mainpage></mainpage>
<archivepage></archivepage>
<itempage></itempage>
<mainorarchivepage></mainorarchivepage>
conditional tags in action
let's pretend that you want to modify your post page so that it has a link back to your
main page. that way if someone has arrived at this post page from a search or an outside
link, they will be able to quickly and easily click over to your main page where your most
current blog posts are.
<itempage><a href="[Link] my current
blog!</a></itempage>
because you've wrapped this particular bit of html in the conditional tag, the only
condition under which this link will show up is when someone is visiting one of your
individual post pages. the link will not show up on your main page. also, feel free to use
the same tags more than once in the template--wherever you need too. neat, huh?
backlink tags
there are two sections of template code that relate to backlinks. one section simply creates
the links that readers see next to your posts. the other section displays the backlinks
themselves. we'll look at these two parts separately.
backlink indicator:
the following piece of code will print a link reading "links to this post." it should be
placed between the <blogger> and </blogger> tags that display your posts, and you'll
probably want it in the byline, near the author's name and the comments links.
<blogitembacklinksenabled>
<a class="comment-link" href="<$blogitempermalinkurl$>#links">
links to this post</a>
</blogitembacklinksenabled>
first, notice the <blogitembacklinksenabled> tags that surround the others. this is so
the rest of the code will only be displayed on posts for which backlinks are enabled. then,
the link tag points to the post page where the backlinks will be listed in detail. you can
put whatever text you like in place of "links to this post."
displaying the backlinks:
this part of the code will also go between the <blogger> and </blogger> tags, but you
will probably also want to enclose them in <itempage> and </itempage> tags as well, so
the backlinks only appear on your post pages, and don't clutter up the main page of your
blog.
<blogitembacklinksenabled>
<a name="links"></a>
<h4>links to this post:</h4>
<dl id="comments-block">
<blogitembacklinks>
<dt class="comment-title">
<$blogbacklinkcontrol$>
<a href="<$blogbacklinkurl$>" rel="nofollow">
<$blogbacklinktitle$></a> <$blogbacklinkdeleteicon$>
</dt>
<dd class="comment-body"><$blogbacklinksnippet$>
<br />
<span class="comment-poster">
<em>posted by <$blogbacklinkauthor$> @
<$blogbacklinkdatetime$></em>
</span>
</dd>
</blogitembacklinks>
</dl>
<p class="comment-timestamp"><$blogitembacklinkcreate$></p>
</blogitembacklinksenabled>
once again, we've enclosed everything in <blogitembacklinksenabled> so posts that
don't allow backlinks won't print anything.
the <blogitembacklinks> tags mark the section of code that cycles through each
backlink to print it out. the <$blogcommentauthor$> and <$blogcommentdatetime$>
tags print out the information you would expect them to, and the
<$blogbacklinksnippet$> tag shows a small portion of the text from the page in
question.
finally, there are a couple little tags to round out the functionality.
<$blogbacklinkdeleteicon$> inserts a delete button for each backlink, but only if the
person viewing it is an administrator of the blog. no one else is allowed to delete
backlinks. the delete button works the same as it does for comments.
<$blogitembacklinkcreate$> creates a link to blogthis!, which readers can use to write
their own blog entries linking to your post.
template tags for site feeds
your site feed settings offer numerous options for post and comment feeds on your blog.
to help your readers find links to these feeds, we've got a couple of tags you can add to
your template. newer blogs - or new templates applied to older blogs - will have these
tags already, but you'll need to add them yourselves if you're using an old template from
before you upgraded your blogger account.
the first piece of code can go in your sidebar, or wherever you'd like it to appear. it looks
like this:
<p id="blogfeeds"><$blogfeedsvertical$></p>
depending on your settings, this code will provide links to a feed of all your blogs posts,
and/or a feed of all the comments on all your posts. if you're using both types of feeds,
the result on your page will look like this:
subscribe to
comments []
posts []
if you're using per-post comment feeds, you'll want to use this second piece of code as
well. you'll probably want to put it inside the <itempage> tags along with the rest of your
comment code. it looks like this:
<p id="postfeeds"><$blogitemfeedlinks$></p>
this will create a link to the site feed containing comments on the current post only. its
output is similar to the previous section:
subscribe to post comments []
finally, you may have noticed that there are <p> tags with ids around each of these
blogger tags. these are optional, but if you want to customize the format of these links,
you can add some code to the style sheet in your template. to do this, find the <style>
and </style> tags in your template, and add the following code between them,
substituting whatever css you want to use:
#blogfeeds {
[insert formatting here]
}
#postfeeds {
[insert formatting here]
}
if you don't know css, or aren't sure what to put here, then don't worry about it. by
default, it will inherit the same style as the rest of your template, which will usually look
just fine.