20 February 2008 Categorized under Uncategorized

Blogger template tags to customize your layout and design

This post is mainly in reply to a comment from a fellow blogger Shankar Ganesh which read

And I have a question: how did you hack the code to display Adsense units under each post header only when a particular post link page is loaded?

The basic idea behind the Ad placement is the correct usage of
“<MainPage> </MainPage>” “<MainOrArchivePage> </MainOrArchivePage>” and “<Itempage> </Itempage>”
(no quotes required) tags provided by blogger. Any thing you put inside these tags will appear only on ‘MainPage,’ ‘Main and ArchivePage’ and ‘Post Page’ respectively. You can use this to specify any piece of code to appear only on the above pages. So basically my code appears like this

<!– Begin #main-content –>
<div id=”main-content”>
<Blogger>
<!– Ad header only on Main or Archieve Page–>
<MainOrArchivePage>
JAVASCRIPT FOR THE LINK UNIT ON MAIN AND ARCHIVE PAGE HERE
</MainOrArchivePage>

<BlogDateHeader>
<h2 class=”date-header”><$BlogDateHeaderDate$></h2>
</BlogDateHeader>

<!– Begin .post –>
<div class=”post”><a name=”<$BlogItemNumber$>”></a>

<BlogItemTitle>
<h3 class=”post-title”>
<BlogItemUrl><a href=”<$BlogItemUrl$>” title=”external link”></BlogItemUrl>
<$BlogItemTitle$>
<BlogItemUrl></a></BlogItemUrl>
</h3>
</BlogItemTitle>
<ItemPage>
JAVASCRIPT FOR ADSENSE 468×90 RECTANGLE HERE
</ItemPage>

And this will tell you how I did this. I used the full code so that all can understand it easier.


Some related articles you may like :

  1. What to do when you can’t log-in to blogger
    Some times Blogger will show a “server was encountering a problem” message when you try to login and will give you an error code and...
  2. AutoSave on Blogger
    Blogger has got Autosave now just like Gmail. The posts will be saved automatically after two minutes each. Autosave is not functional for editing already...
  3. JavaScript in address bar, trick to make images in a web page dance
    I recently found this funny JavaScript code which will make the Images on any page go in a ring like dance. I got it through...
  4. Setting a FAVorite ICON for your site
    This post is an Answer to the comment posted by Carol A Ranney on “How to make custom icons”. A favourite icon commonly known as...
  5. Get GMail much faster and with minimum eye candy – GMail X
    The default GMail user interface is a simple but incredibly powerful one. This is done with AJAX and the time you wait for Gmail to...
  6. How to disable Right Click on a Web Page – with HTML
    Disable Right Clicks using HTML tags. This trick is one of the basic ones. This has hugely been replaced by newer Javascripts and asp codes....

Leave a Reply