Sunday, November 21, 2010

How to Highlight Author Comments in Blogger Posts

In this Blogger tutorial I will show you how to highlight the author comments section of your Blogger template (Blogspot template) using CSS styling.

Benefits of Adding CSS Styling to Author Comments
If you are using a default Blogger template chances are it is difficult to differentiate between comments made by visitors and comments made by you, the blog author. If you only have a few comments per post that may not be enough of an issue for you. If however, you have some posts with lots of comments you may need to make your remarks stand out from those of your visitors. We can do that by adding CSS styling to highlight your author comments.

What Will I Learn in This Tutorial?
In this Blogger tutorial you will learn how to easily add some highlighting to your comments so that they will never get lost in the crowd again. This requires a small amount of tweaking to your Blogger template which is not difficult to do if care is taken. The image below shows one example of what can be achieved using this Blogger hack and some CSS styling.



Will This Blogger Hack Work on My Template?
I have tested this Blogger hack on both the old generation of Blogger templates (Minima and Sand Dollar) and the latest generation of default Blogger templates eg Simple. It will also work on custom templates as the comments code is likely to be very similar.

If you are using a custom Blogger template and run into difficulty you can also try this alternative method to highlight author comments in Blogger posts

How to Add CSS Styling to Author Comments in a Blogger Post
The following instructions will highlight author comments in the comments section of a Blogger post. The code creates a shaded box around the comments made by the blog author. These changes will not affect the CSS the styling of any of the other comments made.

Instructions to Add CSS Highlighting to Author Comments in Blogger

  1. Login to Blogger

  2. From the Dashboard go to Design > Edit HTML

  3. Back up your template by downloading it to your computer

  4. Check the Expand Widget Templates checkbox on the top righthand side

  5. Use CTRL + F by entering the following into the search box

    <dd class='comment-body'>

  6. Immediately above this line paste the following code:

    <b:if cond='data:comment.author == data:post.author'>
    <dd class='comment-body-author'>
    <p><data:comment.body/></p>
    </dd>
    <b:else/>

  7. Now look for this code block

    <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>

    and paste </b:if> immediately after it.

  8. Your code will now look like this:

    <div expr:id='data:widget.instanceId + &quot;_comments-block-wrapper&quot;'>
    <dl expr:class='data:post.avatarIndentClass' id='comments-block'>
    <b:loop values='data:post.comments' var='comment'>
    <dt expr:class='&quot;comment-author &quot; + data:comment.authorClass' expr:id='data:comment.anchorName'>
    <b:if cond='data:comment.favicon'>
    <img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/>
    </b:if>
    <a expr:name='data:comment.anchorName'/>
    <b:if cond='data:blog.enabledCommentProfileImages'>
    <data:comment.authorAvatarImage/>
    </b:if>
    <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>


    <b:if cond='data:comment.author == data:post.author'>
    <dd class='comment-body-author'>
    <p><data:comment.body/></p>
    </dd>
    <b:else/>


    <dd class='comment-body' expr:id='data:widget.instanceId + data:comment.cmtBodyIdPostfix'>
    <b:if cond='data:comment.isDeleted'>
    <span class='deleted-comment'><data:comment.body/></span>
    <b:else/>
    <p>
    <data:comment.body/>
    </p>
    </b:if>
    </dd>

    </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>
    </div>

  9. Now using CTRL + F again find this line ]]></b:skin>

  10. Paste the following immediately before ]]></b:skin>

    .comment-body-author {
    background: #f5deb3;
    border: 2px solid #de7008;
    padding: 5px;
    }

  11. Save your template changes

  12. Click on View Blog and go to a post that you have commented on to see the CSS styling has highlighted your comments.


Alternative Method to Add Highlighting to Author Comments in Blogger
The following method will also add highlighting to author comments in Blogger and can be used if you have difficulty with the first method. It does however involve changing some code rather than just adding some so this is not as desirable in terms of future proofing your template for Blogger updates.



  1. Login to Blogger

  2. From the Dashboard go to Design > Edit HTML

  3. Back up your template by downloading it to your computer

  4. Check the Expand Widget Templates checkbox on the top righthand side

  5. Find the following section of code by using CTRL + F and entering <data:comment.body/> into the search box

    <span class='deleted-comment'><data:comment.body/></span>
    <b:else/>
    <p><data:comment.body/></p>
    <b:include data='comment' name='commentDeleteIcon'/>
    </b:if>

  6. Replace with the following code after <span class='deleted-comment'> and before </b:if> as shown in red:

    <span class='deleted-comment'>
    <!--Highlight Author Comments Start-->
    <b:if cond='data:comment.author == data:post.author'>
    <p class='comment-body-author'><data:comment.body/></p>
    <b:else/>
    <p><data:comment.body/></p>
    </b:if>
    <!--Highlight Author Comments End-->

    </b:if>

  7. Use CTRL + F to find ]]></b:skin> that closes the CSS styling section

  8. Paste the following code immediately above ]]></b:skin>

    p.comment-body-author {
    background: #eeeecc;
    border: 2px solid #335577;
    padding: 5px;
    color:#558866;
    }

  9. Save your template

  10. Click on View Blog and navigate to a post that you have commented on to see the that your comments will now be highlighted


In this Blogger tutorial you have learned two different methods to add CSS styling to highlight the author comments in your Blogger posts. Obviously there is still some work to do on your part to adjust the colors in the CSS styling to match the color scheme of your blog. Good luck!


Related Articles
List of Blog Know How Tutorials for Blogger Blogs
Embedding a Comment Form Below Each Post
How to Get More Comments on Your Blogger Blog
Add Missing Embedded Comment Form to Blogger



Saturday, November 20, 2010

How to Add Internal Links Within Blogger Posts

In the Blogger tutorial I discuss how to add internal links within your Blogger posts (Blogspot posts) to point to either another section within the same post or to another post.

There are lots of times when you may want to direct a reader to a different part of your Blogger post depending on what their needs and interests are. Or you might want to alert the visitor to something significant in a related post. In this article I will show how to make use of internal links both within posts and in Blogger generally.

Why bother with internal linking you may be wondering? Well the answer is to improve SEO. Blogs with a good internal linking structure will fare better than blogs that don't link posts. Plus you will be creating an aid to navigation for your reader. On longer posts jumps links to different sections within your post or to other posts mean readers can quickly find the information they are looking for.

How to Create Internal Links To Sections Within the Same Blogger Posts

How to Create Internal Links To Sections Within Different Blogger Posts

How to Create Internal Links To Sections Within the Same Blogger Post
Consider the above links. Click on them. Each jump the reader to a different part of this article. This type of internal linking is common practice in website building and can be equally applied to blogs to assist with navigation.

How did I create these links? The answer is that I used simple html that anyone can learn in a few minutes. Here are the steps I used to create these links.

  1. Log in to Blogger

  2. Go to Posting > New Post or Edit Post and either create a new article or edit an existing one.

  3. Within the article find a place where you want to add some jump links. This will be early on in the article as it will help the reader figure out what information is significant to them and how to get there quickly

  4. Switch to the Edit HTML mode rather than compose mode so you can see the code you are inserting into your post

  5. Create a couple of headings that will be your links to material further down in your Blogger article. Note you can also just jump to a word but for the purposes of this demonstration and clarity I am going to use headings. When creating this post I used the following headings:

    How to Create Internal Links To Sections Within the Same Blogger Post
    How to Create Internal Links To Sections Within Different Blogger Posts

  6. Add links to your headings like so:

    <a href="#withinposts">How to Create Internal Links To Sections Within the Same Blogger Post</a>

    <a href="#withinblogger">How to Create Internal Links To Sections Within Different Blogger Posts</a>

    • The href attribute and closing </a> element is the same structure you use for other links in your blog

    • Each identifier is preceded by a hash mark (#). The # tells the visitor's browser to look for a section within your post

    • Each link identifier needs its own unique identifier and needs to be enclosed in inverted commas. Use a name that reflects the link you are creating if possible as it will make it easier to identify on a page with a lot of internal jump links.

  7. Now go to the first point in your post where you want to jump the reader to. This will be the start of some new idea, section or logical split in the information.

  8. At this point create your anchor text by first adding your heading and then enclosing your heading with this anchor structure.

    <a name="identifier">a heading</a>

    • Note the use of the name attribute at the beginning and the </a> element at the end

    • Each link identifier needs to be enclosed in inverted commas. Make sure to match up the correct identifier with the one created in step 6


    Using this anchoring structure our first anchor becomes:

    <a name="withinposts">How to Create Internal Links To Sections Within the Same Blogger Post</a>

    Substitute your own link identifier and headings

  9. Now move on to the next point you want to link to and create the second anchor. In this example we use the same structure but change the identifier

    <a name="withinblogger">How to Create Internal Links To Sections Within Different Blogger Posts</a>

    Again substitute your own link identifier and headings to suit your article

  10. Save and Publish as normal and you will see your links are live and will jump the reader to different parts of the post


How to Create Internal Links To Sections Within Different Blogger Posts
Now you know how to create links to sections within Blogger posts let's look at how to create internal links within different Blogger posts.

Most of you will be able to create a link to another post in Blogger using the posts editor. You just highlight the text you want and click on the figure eight icon and Blogger creates the link for you. Which is great most of the time.

However what if we want to direct the visitor to a particular section of a different post? When you create an internal link it will take the viewer to the top of the page but what if you want them to see something near the end of the article? Well using an internal link similar to what we did to create internal links within the post we can.

Say I want to take my reader to a particular post in this case Blogger SEO Tips and Tricks. How would I go about it?

  1. I create the link as usual by copying the article URL address from the browser address bar and using the post editor to add the link. The Blogger post editor uses this structure:

    <a href="URLaddress">linkname</a>

    So the Blogger editor would create the following link:

    <a href="http://blogknowhow.blogspot.com/2009/05/blogger-blogspot-seo-tips-and-tricks.html">Blogger SEO Tips and Tricks</a>

    The link would appear like this in a browser:

    Blogger SEO Tips and Tricks

  2. Now I want to direct my visitors to the section about creating breadcrumb navigation so I add a section name using the following structure:

    <a href="URLaddress#identifier">linkname</a>

    Thus my link would look like this in the Edit HTML section of my post editor

    <a href="http://blogknowhow.blogspot.com/2009/05/blogger-blogspot-seo-tips-and-tricks.html#breadcrumb">Blogger SEO Tips and Tricks</a>

    Note the link seen in a browser remains the same

  3. If you want your link to open in a new browser window add the following to your link:

    <a href="http://blogknowhow.blogspot.com/2009/05/blogger-blogspot-seo-tips-and-tricks.html#breadcrumb" target="_blank">Blogger SEO Tips and Tricks</a>

  4. Now I need to go to the post I am linking to and add the anchor. So in the post SEO Tips and Tricks I would use the following structure to link to the section about how to add breadcrumbs:

    <a name="identifier">a heading</a>

    So the section about breadcrumbs in the Blogger SEO Tips and Tricks article is now enclosed by the following:

    <a name="breadcrumb">Add Breadcrumb Navigation to your Blogger Blog</a>


    If you now click on the link below you will see that your browser open a new window and take you directly to the section about adding a breadcrumb to your blog.

    Blogger SEO Tips and Tricks

  5. Save your changes and publish your article as normal


In this Blogger tutorial you have learned how to add internal links to a particular section of a post from both within the same Blogger post and within a different post. By adding internal links you will help your visitors to find their away your blog more easily and access information quickly. You will also be adding to your blog's SEO by linking related posts.


Related Articles
List of Blog Know How Tutorials for Blogger Blogs
Blogger SEO Tips and Tricks



Friday, November 19, 2010

How to Add a Flickr Slideshow Gadget to Blogger

In today's Blogger tutorial I am going to show you how to add a Flickr Slideshow (Flickr Photostream) to a Blogger blog (Blogspot blog). This Blogger tutorial is suited to beginners and newbies to Blogger and contains step by step instructions to create your Flickr slideshow.

This Blogger slideshow tutorial covers the steps to insert a slideshow widget (slideshow gadget) in the sidebar or footer of Blogger and display a set of images uploaded to Flickr. Note the maximum number of images displayed in the slideshow is 20.

There are several different methods to add a Flickr slideshow to Blogger. Which method you use is largely dependent on your own individual requirements. I cover two different methods in the tutorial.

Method 1 - Add a Flickr Slideshow Gadget to Blogger - Photos in photostream are not organized into sets

Method 2 - Add a Flickr Slideshow Gadget to Blogger to display images that are organized in a set


Method 1 - Add a Flickr Photostream to Slideshow Gadget in Blogger

If you will only ever add one slideshow to Blogger from Flickr and don't want to bother with sets use this method to quickly and easily add your Flickr slideshow to Blogger:

  1. Go to Flickr and find your Photostream link. On your home page when logged into Flickr you will see Your Photostream at the top left under the Flickr salutation


  2. Click on the Your Photostream link and copy the photostream id from your browser address bar.

    http://www.flickr.com/photos/27647187@N07/
    It will look something like this. Copy the identifier eg 27647187@N07

  3. In Blogger go to Design > Page Elements

  4. Select Add Gadget from the sidebar or footer depending on where you want to place your Flickr slideshow

  5. Choose Slideshow from widgets in the Basics list

  6. Choose a title for your slideshow or leave blank

    How to Add a Slideshow to Blogger
  7. Under Source use the drop down menu to select Flickr

  8. Under Option select User

  9. Under Username enter you Flickr Photostream id eg 27647187@N07.

    Note:If you have entered your Flickr Photostream id correctly you will be able to see a preview of your slideshow.

  10. Click on Save and then View Blog to see your new Flickr slideshow in action on your Blogger blog

    How to Add a Flickr Slideshow Gadget to Blogger


Method 2 - Add a Flickr Photostream Set to a Slideshow Gadget in Blogger

If you use sets in Flickr to organize your photos and images you will need to use a slightly different method to install a Flickr slideshow into Blogger.

  1. Log on to Flickr

  2. Upload your photos and create sets to organize your photos if desired

  3. Go to view your sets in Flickr and select the set you wish to use for your Blogger slideshow

  4. In your browser window you will see a URL address similar to the following:

    http://www.flickr.com/photos/27647187@N07/sets/72157624508265319/

  5. There are two important parts to this address that you need to note because we will be using these to create our slideshow:

    • Your photostream - designated by something similar to 27647187@N07

    • The id of the set - designated by something similar to 72157624508265319



  6. In a different browser window log on to Blogger if not already logged in

  7. Go to Design > Page Elements

  8. Select Add Gadget from the sidebar or footer depending on where you want to place your Flickr slideshow

  9. Choose Slideshow from the list of Basics Widgets

  10. Click on the blue plus sign to the right of the Slideshow gadget to activate and configure your Blogger Flickr Slideshow

  11. Choose a title for your slideshow or leave blank

  12. Under Source use the drop down menu to select Other (Note do not select Flickr if you are using a set as this will not work - see Method 1)

  13. In the Feed URL section enter the following feed:

    http://api.flickr.com/services/feeds/photoset.gne?set=72157624508265319&nsid=27647187@N07&lang=en-us&format=rss_200

  14. Substitute your photostream id (this will unique to your Flickr account)

  15. Substitute the id of the set of images you wish to display


  16. Leave the speed of the slideshow at medium unless you specifically need it to be faster or slower

  17. Click on Save

  18. Click on the View Blog link to admire your new Flickr slideshow


In today's Blogger tutorial you have learned two different methods to add a Flickr slideshow to Blogger. Both methods use the Blogger Slideshow Gadget but the difference between them is that method 2 shows you how to use a selected part of your Flickr photostream to create a Blogger slideshow for your blog instead of your whole Flickr photostream. Hope you have lots of fun with this Blogger slideshow gadget. Enjoy!


Related Articles
List of Blog Know How Tutorials for Blogger Blogs