Tuesday, 22 April 2008

Add a Customized Twitter Widget to your Blogger Blog

Twitter LogoTwitter has become one of the most useful social applications for bloggers. Many bloggers choose to feature their latest updates in a widget visible in their blogs. Here at Blogger Buster, for example, you can see a Twitter widget in the header section which features my latest "tweet".

Many readers have emailed me to ask how I customized this widget, so in this post I'll explain some methods you could use to create and customize your own Twitter updates widget, including a simple widget installer for you to add a widget similar to the one used here.






Twitter does offer a "Blogger" widget which can be installed using a one-click installer. This widget does not have any styling associated with it, ensuring your updates will appear in the same fonts and colors as other widgets in your blog.

If you have already added a Twitter widget to your blog, you can easily customize the appearance of this widget using some simple CSS techniques.

The widget code for your Twitter badge will most likely appear like this:

<div <--Add Style Here --> id="twitter_div"><ul id="twitter_update_list"></ul>

<a id="twitter-link" style="display:block;text-align:right;" href="http://twitter.com/amandafazani">follow me on Twitter</a>

</div>

<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script>

<script src="http://twitter.com/statuses/user_timeline/amandafazani.json?callback=twitterCallback2&count=5" type="text/javascript"></script>

As you can see from the comments I added in red, you can add inline CSS styling to your widget code, in order to add borders, background color or even an easily recognizable icon.

Here are some examples of the code you can add in this section:

style="border: 3px solid #cccccc; padding: 5px;" <--This will add a wide grey border around the widget with some padding to ensure the text doesn't get too close to the edges.

style="background: #ffcc00;" <-- This will add a bright yellow background to the widget, ensuring this contrasts with other elements in the page.

style="background: url(http://imagehost.com/youricon.jpg) top left no-repeat; padding-left: 50px;" <--This will add an icon as a background image to your widget. The padding declaration ensures the text does not overlap the icon (this is the solution I use to feature the blue bird in my Twitter icon in the header section).

To add these style declarations into your Twitter widget, simply go to Layout>Page Elements in your Blogger dashboard and click on the "Edit" link for your Twitter widget. Then locate the section of code which begins like this:

<div id="twitter_div"

and add your styling code to this section.

Here is an example of the Twitter widget code with style declarations added in red:

<div style="background: url(http://bloggerbuster.com/images/twitter-icon.gif) top left no-repeat; padding-left: 50px;" id="twitter_div"><ul id="twitter_update_list"></ul>

<a id="twitter-link" style="display:block;text-align:right;" href="http://twitter.com/amandafazani">follow me on Twitter</a>

</div>

<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script>

<script src="http://twitter.com/statuses/user_timeline/amandafazani.json?callback=twitterCallback2&count=5" type="text/javascript"></script>

Add a Twitter Widget using this Widget Installer

For those of you who would prefer a simple method of adding a stylized Twitter widget to your Blogger powered blog, here is a widget installer which will add a widget with an easily recognizable "Twitterific" icon, like this:

The colors and fonts of this widget will blend with other elements of your blog, while the Twitterific icon will be easily recognized and help your readers associate this widget with Twitter.

To add this widget to your blog, simply fill in the details in the form below. Your Twitter username is the one which you have chosen to represent you on Twitter. For example, my username us "amandafazani" and my Twitter URL is http://twitter.com/amandafazani. Add this username into the appropriate box, then change the title and number of tweets to display as suited to your needs.

I hope this post has been informative in explaining how you can add style to your Twitter badge/widget in your Blogger blog. Please let me know what you think by leaving your comments below.


Saturday, 19 April 2008

Complete List of Blogger Tutorials


Here is a complete list of all the tutorials posted on Blogger Buster, organized by category. So please, dive in and read the tutorials which are most useful to you!






Categories

Click on a category heading to skip to this section of the article.


Back to Top

Blogger News and Issues

This section features important news and tutorials relating to your use of Blogger.com.



Back to Top

Custom Domains

This section features tutorials in regard to using Blogger's "custom domains" service.



Back to Top

Customizing your Blogger Template

This section features all the articles I have written with regard to customizing your Blogger templates.

I have further divided this category to help you easily find a particular customization for your needs.


Overall Layout/General Customizations

Here you will find links to posts which discuss general/overall aspects of customizing your Blogger template.



Back to Top

Header/Navigation

These tutorials can help you develop the header and navigational areas of your Blogger template.



Back to Top

Posts

Here you can find links to articles which discuss styling of the main posts area, including the comments and post-footer sections.



Back to Top

Sidebar(s)

These articles have particular relevance to designing your sidebar(s)



Back to Top

Footer Section

This section focuses on customizations for the footer section of your blog.



Back to Top

Feeds and Syndication

These articles discuss your blog feeds and blog syndication.



Back to Top

General Tutorials

This section features general articles of interest



Back to Top

Images, Icons and Badges

Here you will find articles regarding the use if imagery in your Blogger template and posts.



Back to Top

Labels Categories and Tags

This section contains articles discussing the use of labels, categories and tags in Blogger blogs.



Back to Top

Monetize your Blog

These posts feature information about adding advertisements or using Google Adsense in regard to your Blogger blog.



Back to Top

Resources for Bloggers

Here are posts discussing useful resources for bloggers.



Back to Top

SEO and Blog Traffic

This category features posts which discuss search engine optimization (SEO) and generating blog traffic.



Back to Top

Widgets and Add-Ons

Here are articles featuring widgets and add-ons which you can use to add functionality to your Blogger blogs.



Back to Top

Updates

This list will be updated periodically with new articles as they are published on the site. You may also be interested in subscribing to Blogger Buster to receive updates and news articles as they are posted.

I'm always open to suggestions for future articles, so if you have an idea for an article you would like to see published here, feel free to drop me a line.


Friday, 18 April 2008

Fixing PNG Image Transparency in IE6 (Including Background Images)

If you would like to use any transparency for images in your blog, you should be aware that Internet Explorer 6 (and below) does not render PNG transparencies. So if you use a PNG image with semi or full transparency, you would probably see this rendered against a white/grey background when viewed in IE6 (whereas Firefox and other browsers are able to render the transparency just fine).

One solution to this problem is to use GIF images instead, but this does lead to some compromises in design as the GIF format cannot render semi-transparency (where some of the background color is visible through the image).






Recently, Smashing Magazine posted a wonderful article discussing the use of transparency in modern web design. Many solutions for PNG transparency were referenced in this article, but there was one incredible fix which the author missed out: NaterKane's BgSleight script.

Unlike the PNGfix script (which many of us have used to render transparency for foreground images), this script can also display PNG transparency for background images too! It uses a transparent GIF image as a background to the PNG transparency, and although the effect does not render until the page has fully loaded, I'm sure you'll agree this is the best solution so far when using transparency in PNG images for your blog template design.

How to use the Bgsleight PNG Transparency Fix

I've modified NaterKane's original files to make them easier to download and use by bundling the bgsleight JavaScript file and the blank.gif file in a single download, which you can grab below:

Download bgsleight files for PNG transparency fix

Unzip this file and save the contents to a location on your computer. Then upload both bgsleight.js and blank.gif to the same folder location in your hosting account.

You can find a list of free hosting providers here if you do not already have a hosting account for your scripts.

Finally, link to the bgsleight javascript file in the head section of your blog template, like this:

<script src="http://yourhost.com/bgsleight.js" type="text/javascript"></script>

Don't forget to replace yourhost.com with the URL where you have hosted your bgsleight file!

Now when you upload any PNG image with transparency (full or semi-transparency) to your blog template, the page will be rendered correctly for IE6. As I mentioned before, the transparency will not take effect until the rest of the page has loaded, so for a second or so you may still see a border or pale background around your transparent PNG elements. Once the page has loaded, all of your images will appear just as they should, enabling you to create some great effects in your template design.

You may also want to check out Fonsite and Flair in the City to see how this script has been used in other Blogger powered blogs.

Credits and Usage Information

The bgsleight script was originally developed by NaterKane and is distributed under the Creative Commons 2.5 License.

Thank you also to Alfonso of Fonsite for telling me about this highly useful script!

If you have enjoyed this post, please consider subscribing to Blogger Buster for updates of future articles.


Thursday, 17 April 2008

Blogger's bX-Codes Blog (and other useful resources)

I doubt there's anyone using Blogger who hasn't come across one of those dreaded bX-codes at some point or another. These codes are created by the Blogger system when an error occurs to help the Blogger team track down and solve any problems.

If you've ever poked around the source code of an error page, you'd have noticed a section of code which appears like this:

<script type="text/javascript" src="http://bx-codes.blogspot.com/feeds/posts/default/-/bX-gsx5n6?alt=json-in-script&callback=showErrorMessage"></script>
.

The code refers to a JSON-callback to the Blogger Error Codes blog. This is used a "database" of error codes which is used to display a message if the specific error code has been registered on this blog.






The Blogger Error Codes blog uses posts organized by labels attributed to a particular error code. When a particular error occurs, the error page references the bX-codes blog. If this matches an existing label, the body of the post attributed to this label is used to display a message to the user to inform them of the problem or explain that the Blogger team are aware of the problem.

Unfortunately, the error codes blog is not updated very often. This means we usually receive a default error message telling us to inform Blogger of the error code and a description of what was happening when this occurred.

Generally speaking such errors are resolved soon after they appear, especially when people report these error codes directly to Blogger to ensure Blogger employees are aware of the problem and it's scope more quickly.

But it can be quite frustrating to receive continual errors, so I've gathered a few resources which may offer some advice about the error codes you may receive and how these could be resolved:

  • Report your bX-Error code to Blogger: Use this form to report your bX-codes to Blogger directly.

  • The Real Blogger Status (BX codes Section): Chuck is doing a great job of documenting error codes and recent issues with Blogger. In this section of his blog, you'll find loads if useful information about bX-error codes, including their status and possible resolutions.

  • Blogger Known Issues: Here the Blogger team document known issues and error codes with status when these issues are resolved.

  • The Blogger Help Group: It may be helpful to search the official Blogger help group for the bX-code you have received. If this has been experienced before, others may have posted a solution. You may also want to report your error code here as Blogger employees do keep an eye on the help group.

As we can now report error codes directly to Blogger, I hope this will result help the Blogger team correlate and resolve specific codes more quickly. It would be reassuring to receive more messages on our error screens: "Engineers are aware of the problem and are working in a fix" is so much better than a default message telling us to report the problem!

If you know of other useful resources about Blogger's error codes, please let us know by leaving your comments below.


Wednesday, 16 April 2008

Add a "Top of Page" Icon Link

While researching blog designs, I came across a really feature: an icon link to the top of the page which floats in the bottom right-hand corner. As a blog reader, I found this feature to be really useful as it enabled me to jump back to the top of the page after reading a long article or browsing through many posts on the home page. Take a look at the bottom right hand corner of this blog for an example of this in action.

This customization is surprisingly easy to install. You can simply add the code required into an HTML/JavaScript widget in your blog's layout or, if you use a Classic Blogger template, add this code directly into your template code.

So in this post, I'll explain how to add an icon link to the top of your blog with an example image and code for you to use this right away.






How this works

The icon is styled to appear in the bottom right-hand corner of the page (no matter what screen resolution a visitor uses to access your blog), and is linked to target the top of the page using the "#" symbol.

The icon link used in this blog is small and unobtrusive; to help new visitors understand how this can be used, I added title text to the image so the "Back to Top" prompt will appear when the visitor hovers their mouse over the link.

The code used to add a "Top of Page" icon link is constructed as follows (I have forced line breaks for clarity):

<a href="#"> <-- This link targets the top of the page

<img src="url-of-image" <-- The URL of your icon

alt="alternative text" <-- Alt text for accessibility

title="Back to Top" <-- This will produce the hover text

style="display: scroll; <-- This allows the image to scroll

position: fixed;<-- This fixes the image in place

bottom: 5px; <-- Makes the image appear 5px from the bottom

right: 5px;" /></a> <-- Makes the image appear 5px from the right, 
then closes all tags

How to install the "Top of Page" Icon Link

To use an icon link like the one used here at Blogger Buster, simply copy all of the code below and paste this into an HTML/JavaScript widget in your layout:

<a style="display:scroll;position:fixed;bottom:5px;right:5px;" href="#" title="Back to Top"><img src="http://bloggerbuster.com/images/arrow-up.gif"/></a>

If you use a Classic Blogger template (with no drag and drop widgets), you can paste this code into your blog's HTML code, somewhere between the <body> and </body> tags instead.


Customizing the Icon Link

If you would prefer to use a different image than the one used here, simply replace the URL of the image with the URL of your preferred image instead.

You can also reposition the icon to suit your design needs. For example, if you wanted the icon to be flush with the bottom right corner (no space), change the code explained above to read this instead:

position: fixed;
bottom: 0px;
right: 0px;

To position the icon further away from the right or bottom sides, simply increase the pixel value to reflect this distance.


Some Examples of "Top of Page" Icon Links

You needn't be restricted to using an arrow for your top of page link! Some of the designs I showcased in this recent post used ingenious methods of linking to the top of the page:

Left: La Blogueria uses paperclips to link to the top (and other parts) of the blog.

Center: In Tuneando el Blog, the icon link is animated when the mouse hovers over it!

Right: This page curl at the bottom right of Mi-Microsmos is a cleverly disguised (and very stylish) link which features a prompt on mouseover.

I hope this tutorial has been useful and helped you create your own scrolling icon links to the top of your blog.

If you have found this post useful, please consider subscribing to Blogger Buster for updates of new articles as they are published.


Tuesday, 15 April 2008

Blogger Tips at BloggingTips!

Blogging Tips is a group blog where regular writers offer articles and advice about blogging. For the past couple of months, I've been writing regular posts for this popular blog and am now a weekly (staff) writer!

Generally speaking, my posts at Blogging Tips are about using and working with Blogger, including:

Plus a few more too!

Blogging Tips features some really useful posts about blogging in general. My articles about Blogger are published regularly each Monday, so if you're looking for more resources and articles to help you blog more effectively, please check out my posts at Blogging Tips and let me know what you think!

Sunday, 13 April 2008

Popular Posts (Most Commented) Widget for Blogger Blogs

Here is a Popular Posts widget for Blogger blogs which displays a list of the ten most commented posts. This works by parsing the last 5000 comments which have been made on your blog; the post titles and URL are extracted and displayed in descending order of popularity, followed by the comment count of this post.

Over the past few weeks, many of you have expressed an interest in such a widget, and I hope this will become a useful widget for you all.

You can see this widget in action and install this in your own Blogger powered blog using the widget installer below.






Please note: if you are reading this post in your feed reader, you will not see the widget installer and will need to visit this page in your browser instead!



Widget by Blogger Buster
On the right you can see an example of the Popular Posts widget, which displays the ten most popular posts from Blogger Buster (including their comment count). This widget uses Yahoo! Pipes to parse and display each item in the list using the last 5000 comments which have been made on this blog.

Update: I've just changed the mark-up of the widget to capitalize only the first letter of each word in the post titles (thanks to Angel's great advice!)

Installing this widget in your own Blogger blog is easy:

  1. Change the title of the widget if you prefer.

  2. Add your blog's URL in the input box (don't include the http:// part as this is already inserted by the script)

  3. Click the "Customize" button to make the changes take effect, then click on the "Add to Blog" button.

At this point, you will be taken to the widget installer page where you can choose which of your Blogger powered blogs you would like to install this widget.

O Ricardo traduziu este widget para Português que pode ser encontrado nesta página.

A bit more information about this widget

I have developed this widget using Yahoo Pipes, where I added variables to retrieve 5000 comments and extracted the titles and URLs using Regex (regular expressions).

If you would like to take a look at how this works, feel free to hop over to the Blogger Popular Posts/Most Commented Pipe page where you can also make a copy and edit to your own specifications.

Using This Widget in a Blogger Feed Widget (Alternative Installation)

If you would prefer to use Blogger's Feed Widget instead (which loads the items slightly faster), you modify the following feed link to include your own URL (eg: yourblog.blogspot.com or www.yourblog.com) and add insert this as the "Feed URL" on the widget configuration page:

http://pipes.yahoo.com/pipes/pipe.run?_id=1cf38ae68efbe859c4ba1ee239cec099&_render=rss&num=50&url=http%3A%2F%2FYOUR-URL-HERE

However, using Blogger's Feed Widget will limit the number of items you can display to 5 instead of 10, and you will not be able to number your items.

Troubleshooting the Popular Posts Widget

If you have installed this widget in your blog but the post links are not displayed, this may be due to one of the following issues:


You have added your blog's URL incorrectly

Double check your blog's URL when you add this to the widget installer, and remember not to add the "http://" part as this is already added by the script.

Your Comment Feed is Set to None

To remedy this, go to Settings>Site Feed in your Blogger dashboard and click on the "Advanced Settings link. Here you will see the option to switch your comments feed to Full or Short instead of None.

I have tested this widget extensively for both Blog*Spot and custom domain URLs in Internet Explorer and Firefox. So far, I haven't come across any problems, though if you do have a problem with this widget which I've not covered here, please do leave a comment or get in touch and I will try to help.

If you have found this widget to be a useful addition to your Blogger blog, please consider subscribing to the Blogger Buster feed and be updated of new articles about Blogger as they are posted.