Showing posts with label Blogger Tips. Show all posts
Showing posts with label Blogger Tips. Show all posts

Wednesday, December 2, 2009

Add Menu Bar To Blogger Blog


I was able to add a nice multilevel dropdown menu to my blog. In this post I’m going to discuss how you also can add it to your blogger blog. Here I’m using pure CSS multilevel menu generated by Free CSS Drop Down Menu Generator.



You can’t use the code directly in blogger without some modifications; I’ll describe how you can edit the code to use it in blogger to get a menu bar like above picture (Figure 1).

Create the Menu

First get the following code and save it as .html file. Then edit the styles and links as you want. If you like this style, you only need add links for menus and sub menus.

Note : If you use the above mentioned Menu Generator in the HTML code you must replace "<![if gt IE 6]></a><![endif]>" using "<!--[if gt IE 6]><!--></a><!--<![endif]-->", otherwise it will not work in the Blogger.

View Code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
ul.cssMenu ul{display:none}
ul.cssMenu li:hover>ul{display:block}
ul.cssMenu ul{position: absolute;left:-1px;top:98%;}
ul.cssMenu ul ul{position: absolute;left:98%;top:-2px;}
ul.cssMenu,ul.cssMenu ul{
 margin:0px;
 list-style:none;
 padding:0px 2px 2px 0px;
 background-color:#d8d8d8;}
ul.cssMenu table {border-collapse:collapse}ul.cssMenu {
 display:block;
 zoom:1;
 float: left;}
ul.cssMenu ul{
 border-left:2px solid #444444;
 border-bottom:1px solid #444444;
 border-right:1px solid #444444;
 border-top:0px;
 z-index:9999;}
ul.cssMenu li{
 display:block;
 margin:2px 0px 0px 2px;
 font-size:0px;}
ul.cssMenu a:active, ul.cssMenu a:focus {outline-style:none;}
ul.cssMenu a, ul.cssMenu li.dis a:hover, ul.cssMenu li.sep a:hover {
 display:block;
 vertical-align:middle;
 background-color:#d8d8d8;
 text-align:left;
 text-decoration:none;
 padding:4px;
 _padding-left:0;
 font:normal 11px Verdana;
 color: #444444;
 text-decoration:none;
 cursor:default;}
ul.cssMenu span{
 overflow:hidden;
 font-weight:bold;
 background-position:right center;
 background-repeat: no-repeat;
 padding-right:11px;}
ul.cssMenu li {    float:left;}
ul.cssMenu ul li {float:none;}
ul.cssMenu ul a {
 text-align:left;
 white-space:nowrap;}
ul.cssMenu li.sep{
 text-align:center;
 padding:0px;
 line-height:0;
 height:100%;}
ul.cssMenu li.sep span{
 float:none;    
 padding-right:0;
 width:5;
 height:16;
 display:inline-block;
 background-color:#AAAAAA;    
 background-image:none;}
ul.cssMenu ul li.sep span{width:80%;height:3;}
ul.cssMenu li:hover{position:relative;}
ul.cssMenu li:hover>a{
 background-color:#eeeeee;
 font:normal 11px Verdana;
 color: #000000;
 text-decoration:none;}
ul.cssMenu li a:hover{
 position:relative;
 background-color:#eeeeee;
 font:normal 11px Verdana;
 color: #000000;
 text-decoration:none;}
ul.cssMenu li.dis a {color: #AAAAAA !important;}
ul.cssMenu img {border: none;float:left;_float:none;margin-right:4px;width:16px;height:16px;}
ul.cssMenu a:hover ul,ul.cssMenu a:hover a:hover ul,ul.cssMenu a:hover a:hover a:hover ul{display:block}
ul.cssMenu a:hover ul ul,ul.cssMenu a:hover a:hover ul ul{display:none}
</style>
</head>
<body>
<ul class="cssMenu">
 <li><a href="#" title="test title"><span>SEO</span><!--[if gt IE 6]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->
  <ul>
   <li><a href="#" title="test title">Your Site in Google</a></li>
   <li><a href="#" title="test title">Selecting Good Title</a></li>
  </ul>
 <!--[if lte IE 6]></td></tr></table></a><![endif]--></li>
 <li><a href="#" title="test title"><span>Blogger Tips</span><!--[if gt IE 6]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->
  <ul class="cssMenum">
   <li><a href="#" title="test title">Expandable Blogger Posts</a></li>
   <li><a href="#" title="test title">Blogger Title Tip</a></li>
   <li><a href="#" title="test title">Adding META Tags</a></li>
  </ul>
 <!--[if lte IE 6]></td></tr></table></a><![endif]--></li>
 <li><a href="#" title="test title"><span>SharePoint</span><!--[if gt IE 6]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->
  <ul class="cssMenum">
   <li><a href="#" title="test title">What is SharePoint</a></li>
   <li><a href="#" title="test title"><span>Create Custom Features</span><!--[if gt IE 6]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->
    <ul class="cssMenum">
     <li><a href="#" title="test title">Removing Features</a></li>
    </ul>
   <!--[if lte IE 6]></td></tr></table></a><![endif]--></li>
   <li><a href="#" title="test title">CAML in SharePoint</a></li>
   <li><a href="#" title="test title">User Groups</a></li>
  </ul>
 <!--[if lte IE 6]></td></tr></table></a><![endif]--></li>
</ul>
</body>
</html>

Add Menu to Blog

1. Now you have to edit the HTML in your blogger template. To do that first go to "Edit HTML" (Figure 2). (Before editing your template, download the full template)



Find "b:section class='header'" and set the value of "maxwidgets" to 3, if it is less than it (Figure 2). Set "showaddelement" to "true",

2. Then Find the </head> tag in your template and paste the styles just before that tag. Make sure you should include <style type="text/css"> and </style> tags.

3. Now you can add new "HTML/JavaScript" Gadget to your blogger header and paste the code between <body> and </body> from the .html file you created using my code given in the top of this post (Figure 3). There do not give a Title for the Gadget.



Now every thing is ok and view your blog to see the new Gadget.

Wednesday, November 4, 2009

How To Make My Site Appear In Google Search

Search Engine Optimization (SEO) Techniques

If you search the above topic, in many articles you will see the same things like content is king, write unique content, get more back links etc. I was able to get significant traffic in to my blog within a 3, 4 weeks after starting it, because I used something really different than what you saw in other articles about SEO. This is how I did it.

Is the Content King?

Content is impotent but the king is website optimization. So you have to consider on both to get more traffic. You need to have good content but there the important thing is it should be different.

How to Optimize Your Pages?

First consider about Title tag of a particular page, your articles in that page should have a topic containing same key words appear in the Title. You can use bold and italics to highlight the keywords that are relevant to the article. If it is possible try to add those key words in to your main page.

If you are going to add META description tag and the META keywords tag they should have the same keywords that are relevant to the article's topic. Put your article related keywords in between H1, H2 and H3 tags. Use the ALT tag for images is always best practice.

Select the Correct Title for your Article

Here you should consider more about tour article’s title, keywords and header tags. They should match popular search keywords. I have discussed a simple way to do this in my article How to select a Title for my Article.

Back links, How I can Get Them?

Here one way back links plays major role in increasing link popularity. Two way links might be useful but one way back links have much higher weight. By submitting your website to forums, comments on blogs and using social networking websites you can get back links for your web site freely. I will write separate article on this topic soon.

Internal Linking

Internal links are very important. Here the tip is to let the internal link's anchor text contain the same keywords your original article has. For example when linking to your article that is called “ABC” from another page give the same link title as “ABC”.

Frequency of Update, Is It Important?

Yes, search engines give very high weight to frequently updated pages. Your search engine ranking will increase if your website gets updated frequently. More content gives more traffic, which is always true.

My Article Is New; Will It Appear in Search Result?

Yes, time doesn’t matter. You can see some new websites showing up in the top of Google search results after 3 or 4 weeks of their creation, you also can follow these things to achieve that. But remember old pages are always respected by search engines than newer ones.

Tuesday, October 27, 2009

Add META Tags To Blogger

META tags provides information about a web page such as who created the page, what the page is about and which keywords represent the page content. They do not affect how the page is displayed. Many search engines use this information when building their indices.

By default blogger does not contain META tags. In this tutorial I’m going to tell you how you can add META tags to your blog without causing problems. If you simply add these tags you will get "Duplicate meta descriptions" HTML suggestion as following picture.

Let’s see how we can add these tags without causing problems.

1. First log into your blog and from dashboard go to the "Layout --> Edit HTML" page as follows;

2. Then locate the <b:include data='blog' name='all-head-content'/>, you can find it between <head > and </head> tags as following picture;

Then paste this code just after that code.

<b:if cond='data:blog.url == data:blog.homepageUrl'>
<meta content='Insert description here' name='description'/>
<meta content='Insert your keywords here' name='keywords'/>
<meta content='Insert Your Name' name='author'/>
</b:if>

Description : Limit it for maximum 200 characters.

Keywords : Do not repeat more than three times. The maximum number of keywords we recommend for this tag is 20.

Monday, October 26, 2009

Blogger Post Title Tip (SEO)

By default in blogger the blog title appears first before appear your post title. If you consider Search Engine Optimization (SEO) that is not a good practice. In this tutorial I’m going to show you how to make the blogger post title come first as following picture.

You can follow these simple steps to swap the title and post title in blogger for a better Search Engine Optimization.

1. First log into your blog and from dashboard go to the "Layout --> Edit HTML" page as follows;

2. Then locate the <title><data:blog.pageTitle/></title>, you can find it between <head > and </head> tags as following picture;

3. Then replace that code by following code; It is always good if you download the Full Template before editing.

<b:if cond='data:blog.pageType == "index"'>
<title><data:blog.title/></title>
<b:else/>
<title><data:blog.pageName/> | <data:blog.title/></title>
</b:if>

Finally save template and you will see the result immediately in your browser title and after few days in search results.

Saturday, October 24, 2009

Expandable Blogger Posts

This tip can be used in your blog or web site to hide long posts or articles. Inserted of navigating to another page, using this tip you can wrap things like screen shots and source codes that reader doesn’t want to see at the page load.

First go to "Edit HTML" page.

Then find the <head> and </head> tags.

First paste this code between <head> and </head> tags in your HTML code.

<style type='text/css'>
 .commenthidden {display:none}
 .commentshown {display:inline}
</style>
<script type='text/Javascript'>
function togglecomments (postid) {
 var whichpost = document.getElementById(postid);
 if (whichpost.className=="commentshown") {
  whichpost.className="commenthidden"; }
 else { whichpost.className="commentshown"; 
 }
}
</script>

Then put the things that you want to hide between following div tag.

<div class="commenthidden" id="yourDivId">
    your content goes here
</div>

Note: Here "yourDivId" should be unique one. That means if you are going to use this more than one time, you have to replace "yourDivId" using unique name.