Showing posts with label Customize your Blogger Template. Show all posts
Showing posts with label Customize your Blogger Template. Show all posts

July 16, 2008

How to add Quick Edit Pencil to Blogger Posts

The "Quick Edit" pencil icon provides a link to edit our blog posts while viewing blog pages in our browser.

This function is always present in Blogger's default templates. However, if you have customized your template or are using a non-standard template, you may notice this function is missing from your blog pages.

In this quick tutorial, I'll explain how you can check if the "Quick Edit" function is present in your blog template, and how this can be restored if you find it's missing.



Check the quick edit settings

The first thing we should do is check that the quick editing is activated in your blog's settings. To check this, go to Settings>Basic in your Blogger dashboard and scroll down to the section which says "Show quick editing on your blog".


You should ensure this option is set to "yes" and save this setting.

Then go to Layout>Page Elements in your Blogger dashboard, and click on the "edit" link for the Blog Posts widget.

On this pop-up page, you should ensure you have checked the "Show quick editing" option which enables you to quickly edit your blog posts.





Check if the required code is present in the template


Next we need to check if the code required to make these icons appear is still present in your template.

To find out, go to Layout>Edit HTML in your Blogger dashboard. Check the "Expand widget templates" box, then search for this section of code:


<b:includable id='postQuickEdit' var='post'>
  <b:if cond='data:post.editUrl'>
    <span expr:class='"item-control " + data:post.adminClass'>
      <a expr:href='data:post.editUrl' expr:title='data:top.editPostMsg'>
        <img alt='' class='icon-action' src='http://www.blogger.com/img/icon18_edit_allbkg.gif'/>
      </a>
    </span>
  </b:if>
</b:includable>
The easiest way to locate this section is to use your browser's search function and find the following phrase:

b:includable id='postQuickEdit' var='post'
If this section of code is present in your template, you're already halfway towards adding those quick edit icons again.

If this section of code is not present in your template, you will need to copy the entire b:includable section above, then paste this just before the following line of code in your template:

<b:includable id='comments' var='post'>
Once you are sure that this code is present in your template, you need to add a simple line of code to the posts section where you would like your quick edit icon to appear:

<b:include data='post' name='postQuickEdit'/>
In this template, my quick edit icon is located in the "post-footer" section, like this:

<div class='post-footer-line post-footer-line-1'>
<b:include data='post' name='postQuickEdit'/>
</div>
If  the "post-footer-line" section is not present in your own Blogger template, you may prefer to add the quickedit code just after this line instead:

<data:post.body />
Once you have added this line of code, preview your template. The quickedit icons will not appear in the preview, but if you have made any errors during these changes, the preview will make you aware of this.

Finally, you can proceed to saving your template. Then view your blog in your browser. Your quick edit icons should now appear below each of your blog posts which allows you to easily edit posts when you are logged in to your Blogger account.


Did this work for you?

I hope this tutorial has enabled you to restore missing quick edit pencil icons for your Blogger posts with the minimum of fuss!

Please let me know if this tutorial has been useful for you by leaving your comments and opinions below.

Continue reading

July 09, 2008

Create Extra Columns in your Blogger Layout - Magazine Style!

One of the newest (and popular) trends of blog design is the magazine style layout. As the name suggests, this design style presents content in magazine format where extra columns and content are featured on the home page, offering readers an overview of the entire site.

At present, Blogger Buster's home page features a magazine style layout. Rather than display a list of recent posts in typical blog style, the home page summarizes the most recent post, followed by links to other articles by category, and additional information about the site.

Many readers have requested a tutorial to create a similar layout for their own Blogger powered blogs, so in this tutorial I'll explain how you can add extra columns and widget sections on your blog's home page to create a magazine style layout of your own.


How Magazine Style Layouts Work in Blogger

In this template (and also in the Blue Steel template), I have added extra widget sections beneath the main posts column. This allows me to add (or change) the content displayed on the home page from the Page Elements section of my dashboard, without having to manually change my template code.

Also, I have used the b:if function to prevent these widgets from being displayed on post and archive pages (where they are not required).

To create a magazine style for your own blog, you will need to make two main changes to your template:
Insert the code required for your new widget sections
Add relevant styling code to the <b:skin> section of your template to change how these widget sections appear.


In this tutorial, I will explain the simplest method of creating a magazine style front page. This involves adding two columns for widgets (to appear side by side) beneath the main posts section of your blog. Once you have added these sections, you can add widgets and change the settings for your blog to alter the appearance and overall look for your template.

Be sure to back up your existing template before making any changes! Then if you change your mind about your design (or make mistakes during the process) you can easily restore your template.

To make a back-up of your existing template, go to Layout>Edit HTML in your blog's dashboard and click on the "Download full template" link. This will save your template as an XML file to your computer.



Add new widget sections below your posts

To add new columns for widgets below your posts, we will need to add some code to the main posts section of your blog.

Go to Layout>Edit HTML in your blog template, and do not check the "expand widget templates" box. Then search for this section of code in your template:

     <div id='main-wrapper'>
        <b:section class='main' id='main' showaddelement='no'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
      </div>

In your own template, this section may look a little different. For example, you may find <div id='main'> or <div id='content'> instead of <div id='main-wrapper'>.

If you are having problems locating this section, use your browser's search function to locate the phrase "blog posts" or "Blog1", and be aware of the surrounding b:section and div tags.

Once you have found this section in your template, you will need to copy and paste the following code just after the closing </b:section> tag and before the closing </div>


<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:section class='sidebar' id='magazine-left' showaddelement='yes' >
<b:widget id='Text51' locked='false' title='Test Title 1' type='Text'/>
</b:section>

<b:section class='sidebar' id='magazine-right' showaddelement='yes' >
<b:widget id='Text52' locked='false' title='Test Title 2' type='Text'/>
</b:section>

<div style="clear: both;"></div>
</b:if>
By adding this code, we have inserted two extra widget areas which contain a "dummy" text widget so you can preview their appearance. These sections are also contained in <b:if> tags, which determine they are only seen on your blog's home page.

At this stage, you can preview your template and will see these dummy widgets appear below your posts section. However, as we have not yet styled these sections, they will appear beneath each other rather than side by side.


Adding style to your new widget sections

Now that we've added the code required for our new widget sections, we need to add some styling code to ensure they appear side by side.


For this, locate the closing </b:skin> tag in your blog's template. Just before this tag, you should paste the following section of code:


#magazine-left {
  width: 45%;
  float: left;
}
#magazine-right {
  width: 45%;
  float: right;
}

Then preview your template. Now you should see your the titles for the dummy widgets appear side by side with a gap between them. These titles should have similar styling to your sidebar headings and match the overall theme of your template.

Once you are sure everything looks okay, you can proceed to save your template.

If you do receive an error when attempting to preview or save these customizations, click the "Clear edits" button and begin adding your code from the beginning, being extra careful when copying and pasting this code.



Adding widgets and styling your home page

Now that you have added the required code for your magazine style front page, you may want to remove the dummy text widgets and replace them with your widgets of choice.

Simply go to Layout>Page elements in your Blogger dashboard, where you will see your new widgets appear below the Blog Posts section like this:



Click on the edit link for the existing "Test Title 1/2" widgets, and choose to remove these if you prefer. Then add new page elements of your choice to customize the appearance of your blog's home page.

You may also prefer to limit how many posts are displayed on your blog's home page so that your new widgets will feature higher up on your blog's home page.

To change the number of posts which are displayed, go to Settings>Formatting and choose the number of posts to display using the first option on this page:



In many magazine style blogs, only one post is displayed on the home page, but if your posts are short, it should be acceptable to post more than one without affecting the overall look and style of your design.



More ideas for your magazine style design

If you want to take your magazine style design a step further, you may also like to check out these tutorials:

I hope this tutorial has helped explain how to add new widget areas for a magazine-style front page with Blogger. Please feel free to leave your comments and opinions below.

Continue reading

July 03, 2008

How To Add Star Ratings to your Blogger Blog

Star ratings is a new feature currently available through Blogger in Draft. This enables you to add a widget beneath your posts which readers can use to rate your articles on a scale of 1-5, like this:

If you use a default Blogger template, you should be able to activate this feature right away when logged through Blogger in Draft: simply go to Layout>Page Elements and edit the "Blog Posts" widget to activate the display.

However, those using a customized or third party template will need to add the required code to their templates first. In this tutorial, I'll explain how you can add "star-rating" functionality to your customized Blogger template.


To use the "star ratings" feature, you will first need to activate this through Blogger in Draft (it's still in beta, and not yet available for use in the regular Blogger dashboard).

Log into Blogger in Draft and  choose the blog you wish to work with. Then go to Layout>Page Elements, and click the "Edit" link on the "Blog posts" widget.

This screen offers many options for you to add (or remove) from the posts section of your blog. If you scroll down a little, you'll see the "star ratings" option. Tick this option to activate this setting for your blog, then scroll down to save your settings.

If you are using a default template, you should see the star ratings widget appear on the post pages of your blog. However, if you have customized your template (or are using a third party template), it is likely that your template does not include the code required to make the star ratings display.

Here is how you can add the required code for star ratings to your non-standard Blogger template



  1. Go to the Edit HTML page in your blog's dashboard, and ensure you have checked the "expand widget templates" box.
  2. Using your browser's search function, try to find this line of code:
    <div class='post-footer-line post-footer-line-1'>
    If you cannot locate this, search for the following instead:
    <p><data:post.body /></p> 
  3. Immediately after this line (either the post-footer or post.body), add the following section of code:
    <b:if cond='data:blog.pageType == &quot;item&quot;'>

    <span class='star-ratings'>
    <b:if cond='data:top.showStars'>
    <div expr:g:background-color='data:backgroundColor' expr:g:text-color='data:textColor' expr:g:url='data:post.absoluteUrl' g:height='42' g:type='RatingPanel' g:width='180'/>
    </b:if>
    </span>

    </b:if>
  4. Next, find this line in your Blogger template (this should be a little further down):
    <b:include name='nextprev'/>
  5. Just after this line, paste the following section of code:
    <b:if cond='data:top.showStars'>
    <script src='http://www.google.com/jsapi' type='text/javascript'/>
    <script type='text/javascript'>
    google.load("annotations", "1");
    function initialize() {
    google.annotations.createAll();
    google.annotations.fetch();
    }
    google.setOnLoadCallback(initialize);
    </script>
    </b:if>
  6. Then save your template.

Now when you view a post page on your blog, you should see the star ratings appear beneath your posts!

Anurag Bansal has posted a similar tutorial on his blog, Knowliz. If you have any problems with this version, I'd advise you to check out this page instead (thanks for the comment and info, Anurag!).

If you would prefer the star ratings to appear on all pages of your blog, you can remove the lines which include the <b:if> tags. These lines tell Blogger to display the star ratings only on your post pages; removing them enables them to be displayed on all pages of your blog (take a look at this post for more information about the b:if function).

I hope this tutorial will help you understand how to apply the star-ratings function on your Blogger powered blogs! Please let me know what you think about this post by leaving your comments below.

Continue reading

June 27, 2008

How to add a comment form beneath your blog posts

Blogger have developed an inline (embedded) comment form which can be enabled through Blogger in Draft. This is probably the most requested feature for Blogger, and I'm sure many of you will want to use this straight away!

To enable inline comments for your Blogger powered blog, you need to log into your dashboard through Blogger in Draft. Then go to Settings>Comments and scroll down the page to see the new "Comment form placement" setting:


Check the radio setting for "Embedded below post" which will enable the display of the comment form below your blog posts.

If you have customized your template, you will need to make a small change to your template code for this comment form to display. But don't worry, it's a very simple customization to make!

Simply go to Layout>Edit HTML in your blog's dashboard and check the "Expand widget templates" box. Then search for this section of code:


<p class='comment-footer'> <b:if cond='data:post.allowComments'> <a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:postCommentMsg/></a> </b:if> </p>
Replace this entire section of code with the following instead:


<p class='comment-footer'> <b:if cond='data:post.embedCommentForm'> <b:include data='post' name='comment-form'/> <b:else/> <b:if cond='data:post.allowComments'> <a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:postCommentMsg/></a> </b:if> </b:if> </p>
Then save your template. Now when you view a post page in your blog, you should see the new comment form in place!

Update: As many of you have pointed out in the comments, not all templates feature the code I've described above.

Luckily, Is has offered a method which is much easier to use, and has worked for every template I've tried so far. So if my original method isn't working for you, try this instead:

Search for this line in your template code:

<b:include data='post' name='comments' />
Immediately after this line, add the following line of code:
<b:include data='post' name='comment-form'/>
Then save your template. This method adds the required code for the comment form without having to alter the whole comment area, and is very useful if you have experienced problems using the original method Thanks for the hint, Is!

If you don't see your comment form, make sure you have changed this setting through Blogger in Draft and have added your code in the correct place in your template.

You can see this comment form in action beneath this post. Using this comment form allows readers to comment using their Google account, OpenID, Name/URL and all of the settings previously available when using a pop-up or full page comment form (depending on the settings you have chosen).

I am very happy to see that Blogger have listened to our requests and have added this great functionality to our blogs. There are also some other new features added to Blogger in Draft including an improved posting page and import/export features which you can read about in the Blogger in Draft blog.

Please let me know what you think of this new feature by leaving your comments below.

Continue reading

Inline comments are available for Blogger blogs!

I'm thrilled to tell you that the Blogger team have enabled a comment form below the post - Wordpress style! This is probably the feature we ALL wanted added to the Blogger service, so many thanks go out to the Blogger team for enabling this service for us.

The inline comment form is currently available through Blogger in Draft. To activate this, go to Settings>Comments in your Blogger dashboard and scroll down to "Comment form placement" where you can check the radio setting for "Embedded below post".

There is only one problem with this at the moment: those of us who have customized our templates cannot currently use this feature. This is because our templates do not contain the code required to display the comment form. If you use a default template, your comment form should automatically appear below your post once you have changed the comment settings in your blog.

I will post about this in full detail in the next couple of hours with instructions for those who have modified their templates. Update: I have now posted full details for adding comment form functionality to your customized Blogger template, and you can also see this in action beneath this (and every) post on Blogger Buster.

Continue reading

June 24, 2008

Recent Comments for FTP Bloggers

All blogs which are hosted on Blogger publish a comments feed along with their blogs. But those who choose to publish via FTP to their own hosting account are unable to publish a feed for their comments. Update: FTP blogs do publish a comment feed! I have written a separate post about comment feeds for FTP blogs, which includes the URL structure you should use, and also a script which can be used to display recent comments.

Thanks to Pete for this helpful information!

In this post, I'll explain two different methods you could use to display recent comments in your FTP published Blogger blog without accessing the comments feed.

Method 1: Using template tags to display recent comments from the main page


Blogger recommends making use of template tags to display recent comments in the sidebar of Classic templates.

This is not strictly a list of recent comments, as it can only parse and display comments from the page on which it is displayed.

Therefore, on the home page, this code will display comments which are associated with posts displayed on the home page. More recent comments may have been made on previous posts in the archives, but due to the nature of this code, these comments will not be displayed.

If you would like to make use of this method, you can make use of the following section of code:

<MainPage>
<h2 class="sidebar-title">Recent Comments</h2>
<ul>
<Blogger>
<BlogItemCommentsEnabled>
<BlogItemComments>

<li><$BlogCommentAuthor$> //
<a href="<$BlogCommentPermalinkURL$>">
<$BlogCommentDateTime$></a></li>

</BlogItemComments>
</BlogItemCommentsEnabled>
</Blogger>
</ul>
</MainPage>


Paste this code into the sidebar (or other) section of your blog's HTML code, which can be seen in the Template>Edit HTML section of your blog's dashboard.

This will display a list of the names of commenters, followed by the comment permalink.

If you would prefer to also display the body of the comment in this list, you could use the following section of code instead:

<MainPage>
<h2 class="sidebar-title">Recent Comments</h2>
<ul>
<Blogger>
<BlogItemCommentsEnabled>
<BlogItemComments>

<li><$BlogCommentAuthor$> //
<a href="<$BlogCommentPermalinkURL$>">
<$BlogCommentDateTime$></a>
<p class="comment-body">
<$BlogCommentBody$>
</p>
</li>

</BlogItemComments>
</BlogItemCommentsEnabled>
</Blogger>
</ul>
</MainPage>


This will display the commenter's name and comment permalink followed by the entire body of the comment.

Be careful when using this method, as there is no way to display only a summary of the comment. If readers leave rather long comments on your posts, this will take up much space in the sidebar!

Method 2: Using Storago's Recent Comments Service


Storago provides a useful service to display recent comments which will display a true list of recent comments for those publishing by FTP.

This system works by collecting recent comments posted to your blog, and using JavaScript to display them. Storago collects these comments using Blogger's comment notification by email system. You will need to add a unique Storago email address to your comment notification settings for this to work, and it may take a while for the recent comments to begin displaying in your sidebar.

Here's how you can set up the Storago method to display recent comments in your Blogger FTP blog:

Sign up for your free membership to Storago and wait for your welcome email (mine arrived in about 10 seconds, you you shouldn't be waiting too long!) Once this arrives you can validate your membership and log into your account.'

After logging in, you will see a page featuring the tools accessible to you. Choose the "Free recent comments add-on" link.



Then choose to add a new blog.

The following page may seem a little confusing as there are no clear instructions of what you should be doing with the information presented:



On this page, you need to copy the "Comment Notification Email" address, which will be something like recom-123-someword@storago.com.

Then go to Settings>Comments in your Blogger dashboard. Add this email address into the comment notification area near the bottom of the page, then save your settings.



Once you have added the comment notification email address provided by Storago, go back to the Storago page and choose the "Add recent comments to your Blogger template" link. This should bring up a page which looks like this:



You should copy and paste the JavaScript code from inside the gray box into the sidebar section of your blog's HTML code (where you would like this to appear in your design).

By default, the recent comments script is designed to display the commenter's name and the title of the post on which they have commented with the date of the comment beneath.



As far as I can tell, Storago does not allow us to post the body of the comment in the widget. However, we can force the full title and other features by adding code phrases to the JavaScript code (which are detailed on the page where you can find the widget code for Storago).

Comments published on your FTP blog will display in your recent comments widget as soon as they are posted. If you do choose to moderate comments, you will need to approve comments before they are posted in your recent comments widget.

I hope these methods have helped you understand how recent comments may be added to your FTP published Blogger blog without accessing the comments feed.

Please note that this post has now been edited to reflect the information posted by Pete in the comments, and that an update about FTP comment feeds can be read here instead.

Continue reading

June 11, 2008

Display Elements only on Home, Item or Archive Pages in Blogger

Display widgets on pages in BloggerWhen designing your Blogger template, you may prefer certain elements to appear only on certain types of pages.

If you would prefer certain widgets or elements of your design to appear on the home page, but not on individual post pages, for example, you can use the "b:if cond='data:blog.pageType'" function to control this.

In this tutorial, I'll explain how you can easily control page elements to display (or not) on certain types of pages in your Blogger powered blog.

To display elements of your layout on certain page types, you will need to edit your blog's template code.

Be sure to make a full backup of your existing template before attempting to use the information in this tutorial!

To make a backup of your template, go to the Edit HTML page in the Layout section of your blog's dashboard. Then simply click on the "Download full template" link near the top of the page.

This will enable you to save your template as an XML file to your computer, which you can use to restore your template if you accidentally mess things up!

How the layout tags work

The <b:if> function tells Blogger we are setting conditions for the following section of content.

To control whether elements are displayed for a particular page type (ie: index, archive or item pages) we add the data:blog.pageType tag to the b:if statement, and complete this by stating which type of page where we would like this content to be displayed.

After this tag, we add the code or content to be displayed. Then finally we close of the b:if conditional statement with a </b:if> tag.

Trust me, this is not as complicated as it sounds! Let me give you an example.

If I wanted to display a "Welcome to my blog" message only on the home page, I could use the following section of code:

<b:if cond='data:page.type == &quot;index&quot;'>
Welcome to my blog!
</b:if>

This code roughly translates as:

If this is the home page, display my "Welcome to my blog" message.
If this isn't the home page, don;t display anything here!

When we can translate the code into something more understandable, it becomes easier for us to use!

The three different page types

In the example above, I wanted to display my "Welcome" message on the home (or index) page.

In total, there are three page types for which you can use a similar statement:

  • index (the home page)
  • archives (to be displayed when readers view your archive pages)
  • item (the individual post page)

We can replace the &quot;index&quot; section in the above example with either &quot;archives&quot; or &quot;item&quot; instead if we prefer to display only on archive or item pages.

To clarify:

If I want to display my welcome message on archive pages, I would use this section of code:

<b:if cond='data:page.type == &quot;archive&quot;'>
Welcome to my blog!
</b:if>

If I want to display this only on item pages, I would use this code instead:

<b:if cond='data:page.type == &quot;item&quot;'>
Welcome to my blog!
</b:if>

In your own blogs, of course, you may not wish to use this function to display a welcome message! In place of "welcome to my blog", you can insert any type of HTML code you like, such as an image, a hyperlink, and even an entire widget as we will explore below.

You can also wrap existing template code inside the b:if statements: simply type the first line above the section of content, and type the closing </b:if> tag directly below.

How to display widgets on certain page types

When we come to look at how widgets can be displayed on certain page types, the method is slightly more complicated (but not much!).

We cannot wrap an entire widget section in the b:if tags:

Instead, we must check the "expand widget templates" box near the top of the screen, and place the b:if tags just inside the b:includable tags which appear in the expanded widget template code.

Here is a diagram which displays where to add the two b:if lines to make a widget display only on the home page (click on the image for a larger version):

To clarify:

Place the initial <b:if cond='data:blog.pageType == &quot;index&quot;> tag just after the opening <b:includable id='main'> tag.

Place the closing </b:if> tag just before the closing </b:includable> tag.

Note: if you paste the sections of conditional code in the wrong place, you will receive an error message and cannot save your modified template code.

The "if not" statement

Let's say I wanted to display my "Welcome to this blog" message on all page types except for post pages. It would be much easier to say "if this is not an item page, display my message" than to use two seperate statements for archive and index pages.

For this, we can use (what I call) the "if NOT" tags.

In the examples above, you will notice the page type statement contains two "equals" symbols before the page type, like this:

<b:if cond='data:page.type == &quot;item&quot;'>

The doubling of the equals symbols basically tells Blogger:

If this page IS this particular type of page, display the following code.

To tell Blogger to display a section if the page is NOT a particular page type (for example, if the page is NOT a post page), we can substitute the first equals sign with an apostrophe, like this:

<b:if cond='data:page.type != &quot;item&quot;'>

The closing </b:if> tag should remain the same.

To clarify:

In the examples above,

== &quot;[page-type]&quot; (with two equals signs)

This means "If this IS the specified page type, display the content"

!= &quot;[page-type]&quot; (with an exclamation mark followed by one equals sign)

This means "If this is NOT the specified page type, display the content.

Note: these examples are just a part of the complete <b:if> template tags; for the entire conditional page type function to work, you will need to use the complete tags, as referenced above.

There are some limitations...

Unfortunately, there are some limitations when using page conditional tags in Blogger templates which I haven't yet been able to work around:

The "index" page type also functions for search pages and label pages.

Blogger's help center does state that one of the page types is "main", which refers to the home page.

However, using "main" in the pageType statement has never worked for me. Instead, we can use the "index" page type (not referenced in Blogger's help pages for some strange reason...), though this will also affect the search pages, which includes label pages too.

We cannot display elements only on certain page URLS

A few readers have asked if it is possible to display sidebar widgets only on certain post pages (which would be rendered by their unique URL).

I have tried many combinations of template tags, HTML and JavaScript code to accomplish this, but have had no success with this so far.

I have a feeling that Blogger may soon introduce password protected pages (since this is on the current wish list for user voting), though until such template tags are introduced, we are unable to display template elements for certain post URLs.

If anyone has successfully coded either of these two functions, please do get in touch to let me know how it may be achieved in Blogger!

Conclusions

Using the conditional page type function in our templates, we can choose to display widgets and other blog content only on index, archive and item pages. We can also choose not to display specified content on these page types.

I hope this tutorial has offered a good overview of how the b:if and data:page.type template tags can be used in your Blogger templates. Please let me know if this has been useful for you, or if there is anything you would like explained in more detail by leaving your comments below.

Continue reading

June 02, 2008

Top Tips for a Faster Loading Blog

Speed up your blog loading timeBlog readers can be quite impatient. When accessing your blog through search results, Stumbleupon or links to your blog, it is ideal that your entire blog page should load within a few seconds, otherwise such visitors may move on to another site instead.

The question, "How can I make my blog load more quickly?" is one which is asked often by readers of this site. So in this post, I'll offer a few simple tips and tricks you could try which should ensure you have a faster loading blog.

While you may think your blog loads quickly when viewed on your own computer, you should be aware that your visitors may be using different (and possibly slower) connections to access your pages.

The aim of a fast-loading blog is to ensure your pages load in a reasonable time for all connection types.

Those using dial-up will undoubtedly be used to slower page loading times than visitors who have DSL access; however you must also consider that search engine spiders need to access your site and can index pages much more quickly when a site is optimized for speed.

Find out how quickly your site loads

One of the best tools I have found for understanding page loading time is Web Optimization's web page speed report.

This tool is very easy to use: simply type your blog's home page URL into the text box, and hit the "Submit Query" button:

It does take a few minutes to parse the information from your website, though once the page has loaded, you will see loads of useful information about your site.

Now I admit that the information in this page can seem quite intimidating! This service is generally aimed at experienced webmasters who understand the technical details of HTTP requests, external objects and so on. The section we are most interested in is the "Analysis and Recommendations" which will look something like this:

At a glance, we can see which areas of our blogs require some tweaking in order to load more quickly:

  • The sections highlighted in green are the areas of the site which have optimal performance, and do not need to be changed.
  • The sections highlighted in yellow are not critical, but could be optimized for better loading times.
  • Those sections highlighted in red demonstrate areas which really slow down page loading time, and are top of the list for immediate optimization!

If all of these sections display in green and yellow when using this tool, you have little to worry about in regard to your page loading time. However, if you see many red sections you are advised to make some changes to your blog, or potentially lose readers due to excessive loading times!

Ideally, we need to work towards a page loading time of under 8 seconds using a 56k dial-up connection (page loading times will be much faster for DSL and T1 connections).

To achieve this optimal loading time, we need to try to follow these guidelines:

  • The overall size of the page should not exceed 80kb
  • Use as few external JavaScripts as possible
  • Try not to display many images on each page, both in your posts and blog template
  • Aim for the smallest file size possible for your images
  • Reduce the size of your CSS (style) section wherever possible!
  • Make few HTTP requests (in other words, aim to have scripts, images and any other external elements on as few servers as you can!)

This may seem like a lot of work, and if you are new to blogging or web design, it may also seem bewildering! So rather than focus on each factor in great technical detail, I'm going to suggest 6 useful methods you could use to reduce your blog loading time dramatically.

1. Remove any widgets/scripts you don't really need

Unofficial Blogger widgets and JavaScripts can add some great interactive elements to your layout. Unfortunately, each different widget/script you use will need to be referenced from a different server (known as HTTP requests), and will slow down page loading time.

So take a look at all of the widgets and scripts you use in your Blogger layout:

  • Do you really need to have each and every single widget?
  • Does each widget offer some value to your readers?
  • Would your readers really notice (and complain) if you removed a few of these widgets/scripts from your layout?

If you answered "no" to these questions in regard to some of the scripts you use, you should consider removing them from your template altogether.

I know that widgets can help your blog appear more pretty, but consider the impact on your page loading time: you could be losing precious readers if these slow your page down!

2. Try to reduce the amount of images you use in your layout

Loading externally hosted images is another high contribution to your page loading time. So if you use a lot of image-based buttons; feature many image widgets in your sidebar, or use a template which is heavily image based, try cutting down on these to see if this may help your blog load more quickly.

Bonus Tip!

If you really don't want to reduce the number of images you use in your template, you could host these with Blogger instead of an external image host.

To do this, create a new blog post, and upload all of the images you would like to use to this post. These images will then be hosted on one of Blogger's image servers.

Preview your post, and right click on each of these images. You should be able to copy the image location, which you can use to replace the image URLs in your template code.

Using this trick reduces the number of HTTP requests for your images: all of the images you use will be hosted by Blogger, rather than a completely different host. This can have a dramatic impact on your page loading time, especially as Blogger's servers are hosted by Google (which in theory, should be one of the most stable hosts in the world...)

3. Reduce the file size of your images

Another method of reducing the impact of images on page load time is to reduce the file size (not actual size) of all images used (whether in posts or layout).

Many image manipulation programs allow you to optimize images for the web, which reduces the overall file size (in bytes and kilobytes) of the image.

You may also like to try using an online image optimizer to reduce the size of your images. There may be some loss of quality (especially for larger images) but on the other hand, your overall page loading time will be reduced.

4. Simplify your CSS

The CSS section of your Blogger template takes up a lot of the overall file size of your blog pages. This is because each element of your <b:skin> (or <style> for those using classic Blogger templates) is featured on a separate line. There is a lot of unnecessary "white space" (page breaks, indentations and spaces) and possibly HTML comments.

By eliminating unnecessary white space and HTML comments, you can reduce the overall size of your blog pages. However, doing this can make it difficult to edit the style section afterwards!

If you would like to improve page loading time by optimizing the style section of your Blogger template, here is the easiest method you could use:

  1. Copy all of the code between the <b:skin> and </b:skin> tags in your blog's HTML code (for classic template users, this is the section between the <style> and </style> tags).
  2. In a new browser window or tab, visit the CSS Optimizer website, and paste your style code into the "direct input" box.
  3. Click the "Optimize" button (there is no need to check the box which says "do not remove line breaks").
  4. The next page will offer your optimized style code inside a text box, along with data of how much this has been compressed.



    Copy all of this code to your clipboard.
  5. Replace all of the existing code in your Blogger template (between the <b:skin> or <style> tags with this optimized code.
  6. Preview your template to ensure your template displays properly with these modifications, and finally save your template.

5. Optimize the placement of scripts/widgets in your template

There will undoubtedly be some externally hosted widgets and JavaScript's you would like to keep in your layout. To improve the impact these have on blog loading time, you can move these towards the bottom of your template code.

If you use a widgetized layout, move such widgets to your right-hand sidebar (or possibly even the footer section) of your blog. This will ensure that your blog content will appear before these scripts begin to load, so visitors can appreciate your posts while the page continues loading.

6. Reduce the number of posts which appear on your front page

Each post which appears on your home page will add to the overall file size and loading time of your blog.

Even if you only display summaries of your posts on the home page, the entire HTML code for your posts will be visible in the source code. This is because the post summary hack hides the main part of the post using CSS.

When choosing how many posts to display on the home page, you should consider the general length and style of your blog posts.

If you write around 5-600 words for each post, using few or small images (and infrequent multimedia), then 5-7 posts would be optimal to display on your home page.

If you write much longer posts (as I do here at Blogger Buster); use many images, or video in posts, any more than 3 or 4 posts would slow down the loading time of your blog.

On the other end of the scale, if your posts are generally short with few (if any) images, you could probably display 10 or more without affecting page load time.

To change the number of posts which can be displayed on your blog's home page, go to Settings>Formatting while logged in to your Blogger dashboard. The first option enables you to choose how many posts are displayed on the front page:

Overview

When considering how to reduce blog loading time, the main thing to consider is reducing the amount of code and files which are used in your blog's mark-up.

Removing (or optimizing) as much unnecessary JavaScript and images as you are able; reducing the number of posts displayed on the main pages, and optimizing the style section of your blog's template code will certainly help your blog to load more quickly. This is beneficial for new visitors who may become impatient while waiting for large pages to load, and is also a key aspect of optimizing your blog for search engines (as spiders are able to crawl your content more quickly.

A word of caution...

I must tell you that Blogger Buster (in it's current form) is NOT a good example of optimal blog loading time!

The template I use currently requires lots of JavaScript and images; in this instance I have forsaken page loading time for aesthetic appeal...

In researching blog loading time and methods of optimization for this post, I have learned the value of a fast loading blog, and also many methods I could use to ensure this blog loads much more quickly.

Over these next few weeks, I will "practice what I preach" by gradually toning down the use of scripts and images. A faster loading blog will be of benefit to us all!

What do you think?

In this article, I've tried to cover the most significant changes you can make to optimize the loading time of your Blogger blog. Have you used other methods to speed up your own blog's loading time? If so, which methods did you use to achieve this?

Feel free to leave your own ideas and comments by leaving a message below.

Continue reading

May 28, 2008

How to Print your Blogger Posts Effectively

As many of the posts here are tutorials, I thought it would be useful for readers to print off individual blog posts for future reference. Sure, it would be possible for a reader to choose the "print" option from their web browser window, but this would have printed the header, sidebars and other irrelevant sections of the blog, wasting paper and ink and time.

Using a combination of CSS and JavaScript, I've developed a simple yet effective method of printing only the blog post (and comments) from each blog page.

In this post, I'll explain how you can also add effective print functionality to your Blogger posts in just two simple steps.

To get an idea of what this post would appear like when printed, use the "Print Preview" function in your web browser. Whereas the current page appears colorful and includes the header, sidebars and other elements of this template, printed pages from this blog will appear like this instead:

As you can see in this example:

  • The header and sidebar sections do not appear
  • Text is black printed against a plain white background
  • The post spans the width of the printed page
  • The post retains images and formatting
  • Only the necessary areas will be printed!

How to install effective printing format for your Blogger posts

Although it took me a few attempts to ensure my posts would print in this way, I have created this tutorial to make it simple and fast for you to install in your own blogs.

There are only two steps to add this functionality to your own Blogger template:

  1. Add a few lines of CSS code (to make printed pages appear in this way)
  2. Add one line of JavaScript beneath your posts (which creates a link for readers to print the post)

There are a few different options for the style of the print link, as I'll explain below.

Add CSS Style Code to your Blogger Template

To add the print styling code to your Blogger template, simply go to Layout>Edit HTML in your Blogger dashboard, and search for the closing </head> tag.

Immedietly before this line, add the following lines of code (copy and paste this directly to your Blogger template):

<style media='print' type='text/css'>
#header-wrapper, #header, .header, #sidebar-wrapper, .sidebar, #footer-wrapper, #footer, .date-header, .post-meta-data, .comment-link, .comment-footer, #blog-pager, #backlinks-container, #navbar-section, .subscribe_notice, .noprint {display: none;}
#main-wrapper {width: 95%}
</style>

If you like, you can preview your blog before saving. On this preview page, you'll be able to see the print preview displays only your blog posts (not the sidebar or other unwanted areas).

Finally, save your template.

Add a "Print this post" link

To notify your readers that your posts can be printed effectively, you'll probably want to add a "Print" link beneath each of your Blogger posts.

I've created three different styles for the print link, so you can choose the option which works best for your overall design.

To add the print link, go to the "Edit HTML" page again, and this time ensure that you've ticked the "expand widget templates" box.

Now search for this line:

<p><data:post.body/></p>
Immediately after this line, paste one of these three sections of code:

For a simple text link:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<a href='javascript:window.print()'>Print this post</a>
</b:if>

For a button link

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<form> <input type="button" value="Print This Page" onClick="window.print()" /> </form>
</b:if>

For a snazzy link with printer icon

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<span style='background: url(http://bloggerbuster.com/images/print.gif) left no-repeat; padding-left: 20px;'><a href='javascript:window.print()'>Print this post</a></span>
</b:if>

Once you have added this code, save your template. These links will only be visible on post pages (to enable visitors to print the full post and any comments which appear beneath the post), so visit one of your post pages to see the link in action.

You can see an example of the print link near the bottom of this post. If you click on this link, you will be prompted to print this entire post (and comments) using your default printer.

Why it may be useful to enable printing for your Blogger posts

If you publish tutorials or lengthy content, your readers may benefit greatly from being able to print and read your posts offline.

Using the methods outlined here, readers can print only the content of your posts, and not the unnecessary distractions of the sidebar, footer and header sections (which saves on paper and printer ink too!).

You may also want to print off your blog posts for your own benefit, such as to back up your posts in print format, or to demonstrate your abilities in a print portfolio.

Unlike other plugins I have come across, this method also allows you to print any comments under your post too. Comments can add a great deal of value to blog posts, and may contain reader insights which are not included in the body of the post itself.

I hope this tutorial has been useful for you! Please feel free to print this off for future reference ;) and as always your comments are most welcomed.

Continue reading

May 22, 2008

How to Highlight Author Comments

Highlighting author comments using a different background color, border or different style of text helps readers understand when you have personally posted a response.

So far, "How to Highlight Author Comments" has been the most requested article in my Skribit widget, so in this post I'll explain how you can change comments which you have posted yourself to distinguish these from other comments on your posts.

First things first!

The main obstacle I've faced in writing up this article so far is that different Blogger templates code the comments section differently.

While the easiest method for me to write would have been to say "Find this code and replace it with this", such a method would only be usable by bloggers whose template matches the code.

Instead, my explanation may be a little more complicated than usual, though I hope this explanation will ensure anyone using a Blogger template will understand how to implement the highlighted author comments hack!

Backup your Blogger Template!

Before even attempting to customize your Blogger template, the first thing you should do is back up your template. This ensures you can easily restore your original template if something goes wrong. Also, as most of us cannot see comments unless we are viewing a post page, it would be impossible to see if code changes have adversely affected the comments section.

To make a backup of your Blogger template, simply go to Layout>Edit HTML in your Blogger dashboard, and click on the "Download Full Template" link. This will save your existing template as an XML file which you could use to restore your blog, just in case :)

Finding the Comments Block in your Blogger Template

The first thing we need to do in order to implement this hack is to locate the "comments block" within your Blogger template.

To find the comments section, you will need to tick the "expand widget templates" box as this code is contained within your main "Blog Posts" widget.

As I've already pointed out, the section of code used to display comments varies in different templates, so in order to find this section, you may need to search for some specific tags rather than complete sections of code.

To give you an idea of what you are searching for, here is the complete comments-block code from the Minima template:

<dl id='comments-block'>
<b:loop values='data:post.comments' var='comment'>
<dt class='comment-author' expr:id='data:comment.anchorName'>
<a expr:name='data:comment.anchorName'/>
<b:if cond='data:comment.authorUrl'>
<a expr:href='data:comment.authorUrl' rel='nofollow'><data:comment.author/></a>
<b:else/>
<data:comment.author/>
</b:if>
<data:commentPostedByMsg/>
</dt>
<dd class='comment-body'>
<b:if cond='data:comment.isDeleted'>
<span class='deleted-comment'><data:comment.body/></span>
<b:else/>
<p><data:comment.body/></p>
</b:if>
</dd>
<dd class='comment-footer'>
<span class='comment-timestamp'>
<a expr:href='data:comment.url' title='comment permalink'>
<data:comment.timestamp/>
</a>
<b:include data='comment' name='commentDeleteIcon'/>
</span>
</dd>
</b:loop>
</dl>

If you are using Minima (or a similar template) you should be able to locate this section of code easily. However, some templates use <ul> and <li> instead of <dl> and <dd> tags, in which case the code you are looking for may look more like the section on this page instead, or could even be wrapped in simple <div> tags.

If you are having trouble locating the comments section in your blog's HTML code, do a CTRL+F (or CMD+F for Mac users) search within your template code for the following template tags:

  • <b:loop values='data:post.comments' var='comment'>
  • <data:comment.author/>
  • <data:comment.body/>

The comments section of your blog's HTML code should contain all three of these template tags. Simply locate these tags and the surrounding code in your template, then work out where this section begins and ends using your discretion.

Generally speaking, this section will usually begin with <dl> or <ul> or <div> and end with a matching closing tag.

Changing the comments code to add author highlighting

Once you have located your comments section in your blog's HTML code, you will need to highlight this entire section of code and replace it with the following section of code instead:

<ul class='commentlist' style='margin: 0; padding: 0;'>
<b:loop values='data:post.comments' var='comment'>
<b:if cond='data:comment.author == data:post.author'>

<li class='author-comments' style='margin: 0 0 10px 0;'>
<b:if cond='data:post.dateHeader'>
<div class='commentcount'/>
</b:if>
<cite>
<b:if cond='data:comment.authorUrl'>
<a expr:href='data:comment.authorUrl'><data:comment.author/></a>
<b:else/>
<data:comment.author/>
</b:if>
</cite>
<br/>
<div style='clear: both;'/>
<b:include data='comment' name='commentDeleteIcon'/>
<p><data:comment.body/></p>
<div class='commentlink-date'><a class='commentlink' expr:href='"#comment-" + data:comment.id' title='comment permalink'>
<data:comment.timestamp/>
</a></div>

<div class='clear'/>

</li>


<b:else/>

<li class='general-comments' style='margin: 0 0 10px 0;'>
<b:if cond='data:post.dateHeader'>
<div class='commentcount'/>
</b:if>
<cite>
<b:if cond='data:comment.authorUrl'>
<a expr:href='data:comment.authorUrl'><data:comment.author/></a>
<b:else/>
<data:comment.author/>
</b:if>
</cite>
<br/>
<div style='clear: both;'/>
<b:include data='comment' name='commentDeleteIcon'/>
<p><data:comment.body/></p>
<div class='commentlink-date'><a class='commentlink' expr:href='"#comment-" + data:comment.id' title='comment permalink'>

<data:comment.timestamp/>
</a></div>
<div class='clear'/>
</li>

</b:if>
</b:loop>
</ul>

The simplest way to change your comment code is to follow these steps:

  1. Copy the code above to your clipboard
  2. Highlight the entire section of your comment code in your Blogger template
  3. Paste the code from your clipboard in place of the existing code by keying CTRL+V (or CMD+V).

One quick method to check if you have made code errors is to preview your template. If you have accidentally omitted some code, you will receive an error message. In this case, you should press the "clear edits" button and begin again.

If you don't get an error message, you can then proceed to save your template.

Adding style for author comments

At this stage, your own comments will still appear in the same style as other comments. To highlight author comments, we need to add some style code to your blog template.

This step is much easier than locating and changing the comment section. Simply locate the closing </b:skin> tag in your Blogger template, and immedietly before this, paste the following section of code:

.author-comments {
background: #cccccc;
border: 1px solid #333333;
padding: 5px;
}

If you prefer, you can change the hex colors (#cccccc and #333333) to match the color scheme of your own template (discover the color codes for your preferred schemes using the web color calculator).

Then save your template.

Now when you make a comment on your blog while signed in to your Blogger account, your comments will have a different border and background color to comments posted by your readers.

Here is the effect of this author comment highlighting hack as seen in one of my test blogs:

I hope this tutorial has helped you discover how to highlight author comments in your own Blogger blogs.

You may also be interested to read how I added MyBlogLog comment avatars, which is the method I use here to distinguish between my own and readers comments.

Please let me know your opinions of this post by leaving your comments below.

Continue reading

May 17, 2008

How to Install Intense Debate Comments in Blogger Blogs

Intense Debate is a commenting system which is designed to inspire conversation. Including such features as threaded comments (allowing readers to reply to each other in comment threads), avatars and a voting system, many Blogger users are now choosing this as an alternative to the default Blogger commenting system.

Many readers have requested a tutorial about installing and using Intense Debate. So in this post I'll explain exactly what this new service has to offer, and how easily this can be installed in your Blogger powered blogs (including some troubleshooting tips to make sure everything runs smoothly!)

What Are the Main Features of Intense Debate?

Intense Debate is a fully featured commenting system which provides many more features than Blogger's standard comments, including:

  • Comment form beneath posts (on the same page)
  • Threaded comments, which allow commenters to reply directly to each other and be visible as a comment "heirachy"
  • Comment avatars (of registered Intense Debate members)
  • The ability to vote comments up/down (so the most popular comments can float to the top of the list)
  • Profiles for registered members, which include links to members' blogs and social media profiles
  • Widgets for top commenters and recent comments which you can add to your Blogger layout with ease

You can read about these features in full detail, or watch the two minute video of Intense Debate functionality which explains this service in a snap!

How to Install Intense Debate i