Please don't click on these links yet.

Under construction: ? * # 0-9 |A |B |C |D |E |F |G |H |I |J |K |L |M |N |O |P |Q |R |S |T |U |V |W |X |Y |Z

Your opinion is needed with a new "FAQ" I'm thinking of writing up. Click on this "FAQ link" now and leave a comment if you can spare the time.
Tutorials : How I made it toolbars paginations buttons widgets tweeks mega tweeks everything else inspiration ideas FAQ problems Fixing problems

Add a Sitemap to your blog

Monday, July 2, 2012  at 1:33 AM
This should be a simple and short tutorial because it only involves 4 lines of code copied and pasted to a page or new post. You'd think it should be a short tutorial but after thinking about this topic I decided to add some "NEED TO KNOW" information about this widget that will help you immensely. Please read this tutorial from beginning to end before adding the sitemap code to your blog.

Sitemaps on a website are always very useful. It is a known fact that when a visitor becomes stuck, either because of poor navigation, not knowing where to look for something, or is just having a hard time finding what they are after, they will always turn to a sitemap or table of contents page if they can find it. If they cannot find either page they will leave your website or blog and go elsewhere.

Some months ago I found several sitemap/table of contents widgets. I wanted to add one to one of my other blogs. I tried a few of them out but most of them were really complicated, and I had to add the urls manually into the sitemap.

To be honest I don't like wasting my own time trying to achieve something. Having a sitemap on any blog, even if it is not submitted to Google or some other place, is a really wonderful thing. People will stay on your blog a lot longer simply because you have a sitemap or table of contents page.

Of all the Sitemap widgets/code out there, I am going to give you the code for the best one available, and talk about it a bit more.

Below is the code for the same sitemap that I am using on this blog. I located this sitemap widget at http://www.abu-farhan.com

Here is the sitemap widget code:

<script src="http://scriptabufarhan.googlecode.com/svn/trunk/daftarisiv2.js">
</script><script src=http://bloggertutorialsabforeveryone.blogspot.com/feeds/posts/summary?max-results=9999&amp;alt=json-in-script&amp;callback=loadtoc>
</script>

That's all there is to it, just six lines of code.

Now, before you add the six lines of code to your own blog, THERE IS SOMETHING YOU NEED TO KNOW ABOUT THIS WIDGET. The sitemap will not have a white background as it is supposed to, if you have, let's say, a blue coloured background for your posts. I don't know why that is so, but that is just how it is with this widget. SO, BEFORE YOU ADD THIS WIDGET TO YOUR BLOG PLEASE CHANGE THE COLOUR OF YOUR POSTS' BACKGROUND TO A WHITE OR VERY PALE COLOUR THEN SAVE YOUR TEMPLATE. This you must do otherwise the sitemap will simply not display properly, or at all. If you don't change the colour of your posts background you will have to delete the widget and start all over again.

HOW TO ADD THE SITEMAP CODE TO YOUR BLOG:
Firstly you need to think about where you are going to put the sitemap on your blog. The best place to put the sitemap code is in one of the ten static pages that you have on your blog. But if you have used up all your ten static pages, then simply place the Sitemap code into a new post.

Once you have figured out where you want to put the sitemap, you can now copy the six lines of the sitemap code and paste it into the 'EDIT HTML" tabbed section - the tabbed section appears when you are editing a post or static page. Do not paste the code into the "Compose" section.

With the sitemap code pasted in the "Edit HTML" section of the post or page, if you click on the "Compose" tab nothing will show up. All that you will see is an empty white page and it looks like nothing has been added to that section at all. If nothing at all shows up in the "Compose" section then the sitemap code is working properly. The blank white page in the "Compose" section is exactly what is supposed to happen, so do not think you done something wrong. You have not done anything wrong - in fact, you added the code correctly.

I do not know why the sitemap code is supposed to go in the "Edit HTML" section, but what I do know is if you place the code in the "Compose" section the whole sitemap widget will not work and it will only display some of the javascript code itself if you click on publish then view that post or page. So just remember, place the code into the "Edit HTML" section, and it will display perfectly.

Now before you click on "save" you have to change the url in blue to your own url. If you do not change the url one of two things will happen. 1. The sitemap will not display anything at all. Or, 2. The sitemap will retrieve all my information from my blog and will add it as your own sitemap's content. So, please change my blog's url to your blog's url - only the part in blue remember, and then click on "save". That's all that you have to do.

BUT HOW DO I CHANGE THE LOOK OF THE SITEMAP ITSELF TO DISPLAY OTHER HEADINGS?
For the time being you may like the overall look of your new sitemap but after looking at it you may want to change how everything is listed in the sitemap itself. Well, let me tell you a little secret: Everything listed in your sitemap is entirely dependant on what "Labels" you give each post. Each "Sitemap HEADING" is actually an individual "LABEL" for each blog post.

Confused? Okay, let me tell it this way, and hopefully you will understand it better. Every time you add a new label to a blog post those labels become individual "HEADINGS" in your sitemap. For example, I have only added "Blogger tutorials" as this post's labels. The moment I publish this post that label will automatically be added as a new "HEADING" in my sitemap.

Underneath each "HEADING" in the sitemap will be a list of blog posts that will have the same labels attached to them. And that is how this sitemap code works and displays the contents of your sitemap.

But let's say you want to change the "HEADINGS" of your sitemap, and the list of blog posts that will be displayed underneath each heading. Okay, the very first thing you need to do is think about, and even write it down on paper, of how you want all your blog posts to appear in the sitemap. Let's say you have a blog about dogs, and that is all you write about. Sorry, I couldn't think of anything else. Let's say you want these particular headings:

* Tall dogs
* Short dogs
* Purebred dogs
* Mongrels
* Hybrids
* Police dogs
* Working dogs
* Unusual breeds of dogs
* Strange behaviour of dogs
and,
* Native wild dogs

Let's also say you already have 251 posts about all the dogs you could ever think of on Earth. Now, because this sitemap widget does not allow for subheadings to be added to the sitemap itself, your only option with this particular widget is to reword the title of each blog post.

The title of each blog post is what will be displayed underneath each heading in your sitemap. So, you will need to come up with a clever way of displaying the contents of your sitemap underneath each of the ten headings about dogs.

For example, let's say you wrote an article about Police dogs, and it was about "Training German Shephards from a young age". Maybe you gave the post this title: " German Shephard Police Dog training". Anyway, let's say you have similiar post titles but the contents of each post is different in regards to German Shephard Police Dogs being trained. You simply reword each blog title so it looks more like the table of contents page of a book. Give your blog post titles very specific "titles" so they will be more of an accurate description of the contents of the blog posts. For example, instead of having the title " German Shephard Police Dog Training" you could give it the title of "Training German Shephards at a young age", or to actually give your sitemap subheadings, reword it to something like this: "German Shephards: Training young dogs".

THE SITEMAP LISTS EVERYTHING ALPHABETICALLY
The sitemap will automatically put everything into alphabetical order for you, but it also has the habit of separating capital letters from lowercase letters at the beginning of each label. Every number label you add (e.g. "2011" or "200BC", etc) will always be at the very top of the list in the sitemap. All words that start with a capital letter that you add to a post as a label will be displayed in the middle of the list in the sitemap. And every lowercase word that you add to a post as a label will automatically be put at the bottom of the list. Within each of these three sections (numbered labels, Capital letter labels, and lowercase labels) each lot of posts will also be categorized alphabetically within/underneath each heading. So, the trick is to start each label with a capital letter. It will look like this, from top to bottom in the sitemap:

2011
Little dogs
big dogs

HOW TO AVOID BLOG POSTS FROM APPEARING MORE THAN ONCE IN YOUR SITEMAP?
There is only one solution for this and that is to only give each post one "label". If you really want a neat and tidy sitemap it is better to relabel all your posts so each post is displayed underneath the appropriate heading, and begin each "label" with a capital letter.

HOW TO CHANGE THE LABELS FROM LOWERCASE TO CAPITAL LETTERS:
If labels frustrate you when you try to change them there is an easy and quick way that will eliminate your frustration. Normally if you change a label and save it the label will resort back to the original label you gave a blog post. It doesn't matter what you type in as a label, it will always revert back to the original label. This is simply because the label you want to change will always exist until you delete it.

The trick to this solution is simple. What you do is open the blog post in the "Edit" section and delete all the lowercase labels, or the labels you want to change. Then you click on the "save as draft" button underneath. You will then be shown the "Edit Posts" page. Locate the blog post you just deleted the labels from and click on the "Edit" link next to it on the left. Your old labels have now been permanently removed so you can now add new labels all starting with a capital letter, or however you want your sitemap headings to appear as.

Once you have added the new labels to the post click on the "Publish Post" button and you are done.

Now that you have read this post in its entirety you can now go ahead and change your posts' background colour to "white", save it, and add the sitemap code to your blog. Have fun with it.

3 comments:

  1. Hello Shirley. I know this doesn't have to do with the post but I was wondering this:

    If you add H2 text to a post, I would think that if I wanted to jump to that heading, the URL would be http://blog.blogspot.com/#Your_H2_text but Blogger doesn't seem to work that way. Do you know what the URL for H2 headings would be.

    At Anomalistics Incorporated, I'm planning on adding a Table of Contents to posts, where people could just jump to headings (I think it would actually be a lot more organized.). Do you know how to achieve this?

    ReplyDelete
    Replies
    1. There is a way to do that, I think. I'm not entirely sure how but I will check it out for you. I read on some website (forgotten which one - it was a few months back) about how to create links that jump to certain locations on a website. Oh yeah, I remember the word "anchoring" in reference to links. I believe I tried it out once and it worked but how to make it work with post h2 links may take me a bit longer to figure out. I'll get back to you on this one, okay. Just keep bugging me for an answer, else I'll forget.

      Delete
Your Answer Thanks for contributing an answer to Blogger Tutorials for everyone! Please make sure your answer is NOT a SPAM comment, as such comments will be deleted. Provide details and share your research. Avoid statements based solely on opinion; only make statements you can back up with an appropriate reference, or personal experiences. Comment Options to add to the form below:
Of course, you can add various combinations of the above to your comment as long as you place the ending tags in the right locations.


Features:

To change your text to bold simply type in a left facing arrow then a UPPERCASE letter b then a right facing arrow. Then add your text, followed by typing in a left facing arrow, then type in /B and then a right facing arrow.

To change your text to italics simply type in a left facing arrow then a lowercase letter i then a right facing arrow. Then add your text, followed by typing in a left facing arrow, then type in /i and then a right facing arrow.

To change the colour of your text type in [co="red"]Add your text here[/co] You can change the colour of the text by either typing in the colour's word or by adding a hex colour code that includes the hash symbol.

Your text goes here. To add a marquee text type in [ma]Add your text here[/ma]

To add an image or gif type in [im]Add your image or gif URL here[/im]

Of course, you can add various combinations of the above to your comment as long as you place the ending tags in the right locations.

To add a Youtube video as a comment use either one of the two codes below and replace the video url with the one you want to add as a comment.
[video=ADD-ENTIRE-VIDEO-URL-THAT-YOU-VIEW-ON-THE-WATCH-PAGE-ON-YOUTUBE-HERE]
[video=ADD-ENTIRE-VIDEO-URL-THAT-YOU-VIEW-ON-THE-watch?feature=player_detailpage-HERE]

Scrollbox codes

<a target='_blank' title='DON'T TOUCH MY PHONE' href='ADDYOURURLHERE'><img src='https://lh4.googleusercontent.com/-qSyLJ0X94nk/T-_ekHbo_mI/AAAAAAAAHmY/qk0v-X5s32s/s320/58298-dont-touch-my-phone.png' border='0'/></a>

This free script provided by
JavaScript Kit

FAQ

YOUR OPINION COUNTS! A list of topics that I am thinking of writing about but need feedback from visitors before I go ahead with it.

Click to view more Pages
 

This site consists of tutorials that you would not normally see elsewhere. I am adding tutorials that I have either tweeked or created myself, using existing code already found on the Internet.

Back To Top Image by Cool Text: Logo and Button Generator - Create Your Own Logo

Scroll to Bottom Back to Top