Friday, May 15, 2009

How to: add a "recent posts" widget to your blogger page

Skill level: Easy, Skills required: no special skills needed

Adding a recent posts widget is really very simple. On your Edit Layout: Page Elements page add a new gadget. Select the Feed gadget and enter your blog's RSS feed URL and presto, you have a recent posts widget. The same thing can be done to add a recent comments widget.

Here are the standard feeds for your blog:
Post feed:
http://YOURBLOG.blogspot.com/feeds/posts/default

Comments feed:
http://YOURBLOG.blogspot.com/feeds/comments/default

How to: show "read more" links on archive pages in blogger

Skill Level: Easy, Skills Required: CSS, HTML

Often times on archive pages you do not want to display entire posts. You want to have a list of posts that the reader can easily scroll through to find what they are looking for. One option is to just display the title of each post, but if you are like me and don't always come up with descriptive titles a better option might be to the display the title and a preview of the post with a "read more" link.

Step 1: Set up your posts to have 2 parts…the first is the preview section and will always be displayed, and the second will be the full text section that will not be displayed on an archives page. In each of your posts, click the button to Edit HTML. Then, put <span class="fulltext"> at the point you want the preview section to end and the fulltext section to begin. Then at the end of your post put </span>. This can be a rather lengthy process to manually enter all these span tags, especially if your blog is already established with lots of posts, however, on some of your shorter posts you probably don't even need to specify a fulltext section as it will be okay if the entire post shows on an archive page.

Step 2: Add a "read more" link to the end of every post. In step 3 we will hide this link when not on an archives page. Go into your Layout: Edit HTML page and click the checkbox to Expand Widget Templates. Find the post body and add <span class='read-more'><a expr:href='data:post.url'>[...]</a></span> right after . This will add a […] to the end of every post that the reader can click on to view the entire post.

Step3: Use CSS and blogger server side code to set up some conditional formatting. We want to display the read more link, but not the fulltext section or the post footer when on an archive page. Conditional formatting must be inside a <style> </style> tag. Some templates don't have these so you may have to add one to the end of the <head> section. Code the following:

<b:if cond='data:blog.homepageUrl != data:blog.url'>
<b:if cond='data:blog.pageType != "item"'>
.fulltext {display: none;}
.read-more {display: inline;}
.post-footer {display: none;}
<b:else/>
.fulltext {display: inline;}
.read-more {display: none;}
.post-footer {display: block;}
</b:if>
<b:else/>
.fulltext {display: inline;}
.read-more {display: none;}
.post-footer {display: block;}
</b:if>

You can view this code in action on my main blog, Fight For Iowa.

Wednesday, May 13, 2009

How to: creater a simple navigation menu

Skill Level: Easy, Skills Required: CSS

Navigation menus are very popular on websites these days and are relatively easy to create. Blogger has some good tools for creating your own for your blog. With a little CSS coding you can customize a Links List widget and turn it into a simple navigation menu.

Step 1: Add a Links List widget on your Layout: Page Elements page. Don't type anything for a title or anything for the number of links to show. You can have it sort if you want...but generally I like to choose the order myself. Add links you want in your navigation menu. Links like Home or About are popular. Once done, save your Link List widget.

Step 2: Drag your new Links List widget to the top of the page between the header and the blog posts (most templates have a section for this).

Step 3: Customize the style using CSS to display the links in a horizontal line instead of a bulleted list. The widget likely has the id LinkList1 (unless you have built another link list before). You will need to go to the Layout: Edit HTML page. Add the following CSS to display horizontally without bullets is:

#LinkList1 li {
diplay: inline;
list-style-type: none;
}

Step 4: Further customize the CSS to have a background color, then a new color to highlight the link when you hover over it. Use the following CSS with your own colors:

#LinkList1 a {
background-color: #CCCCFF;
}

#LinkList1 a:hover {
background-color: #F0F0FF;
}

Step 5: Enjoy your new navigation menu! There is plenty more you can do customizing the CSS further, but this example gives you the basic idea.

Tuesday, May 12, 2009

Welcome to How To Blogger Better

I've been blogging on my main blog, Fight For Iowa, and in the process have been looking for ways to improve the function of it on Blogger. Along the way I have learn some different techniques, some that I could find out on the web and some that I could not. So I look I'd share what I learned and as I learn more, I will continue to share.