Blog Help
  Home arrow Blog Help arrow Page 3 - Setting a Static Front or Main Page in Blogge...
Affiliate Promotion  
Blog Help  
Domain Name Tips  
How To  
Newsletter Marketing  
Online Business Help  
Search Engine Tricks  
Web Development  
Web Hosting  
Website Advertising  
Website Content  
Website Marketing  
 Webmaster Tools
 
Base64 Encoding 
Browser Settings 
CSS Coder 
CSS Navigation Menu 
Datetime Converter 
DHTML Tooltip 
Dig Utility 
DNS Utility 
Dropdown Menu 
Fetch Content 
Fetch Header 
Floating Layer 
htaccess Generator 
HTML to PHP 
HTML Encoder 
HTML Entities 
IP Convert 
Meta Tags 
Password Encryption
 
Password Strength
 
Pattern Extractor 
Ping Utility 
Pop-Up Window 
Regex Extractor 
Regex Match 
Scrollbar Color 
Source Viewer 
Syntax Highlighting 
URL Encoding 
Web Safe Colors 
Whois
 
Forums Sitemap 
Mobile Linux 
APP Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BLOG HELP

Setting a Static Front or Main Page in Blogger
By: Codex-M
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2009-04-20

    Table of Contents:
  • Setting a Static Front or Main Page in Blogger
  • Google Classic Blogger Template Structure and Code
  • Formulating the Code to Edit the Template
  • Implementation and Testing of the Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Setting a Static Front or Main Page in Blogger - Formulating the Code to Edit the Template


    (Page 3 of 4 )

    We begin by analyzing the code that will display the content of the post. By default, since the post will be shown on the front page when it is published, we can then set conditions to display our customized home page content (not post content written via Blogger content management system control panel) when the page shown is the front page.

    Note that by default, Blogger will display seven posts. We need to display only one post in the main content. To do this, go to: Dashboard---Settings---Formatting and set it to display one post on the main page.

    The content function before we start looks like this:

    <div class="post-body">

    <div>

    <$BlogItemBody$>

    </div>

    </div>


    However, we need to show the post <$BlogItemBody$> only on the post pages and not on the front page. This will now be:



    <ItemPage>

    <div class="post-body">

    <p>

    <$BlogItemBody$>

    </p>

    </div>

    </ItemPage>


    We are adding the conditional tag <Itempage> to signify that the command within will only be TRUE on the post pages but FALSE on the main page and the archive pages.

    We still lack the command to run the home page, since the above code is for the post pages. For the main content, which will now be static, it will be:


    <MainPage>

    <div class="post-body">


    <br></br>


    Insert homepage content here......................


    <br></br>


    </div>

    </MainPage>


    Take note the similarity between the first and second set of code. The differences are the template tags and content used.

    Here, using <MainPage> means that the content within these tags will be shown only on the front page, and not on the post and archived pages.

    As for the archived pages, here is the code used by Blogger to display only a hyperlink to the post pages for articles written in a particular month:

    <ArchivePage>

    <div id="main">

    <p>

    <a href="<$BlogItemPermalinkURL$>"><FONT SIZE=3><$BlogItemTitle$></FONT></a>

    </p>

    <br />

    </div>

    </ArchivePage>


    We do not need to show the dates, so the header code date specified above will be removed. And we need to display post titles and post footers only on post pages, not on archived pages and the front page. So the new code will be:


    <Itempage><BlogItemTitle></Itempage>

    <Itempage><h3 class="post-title">

    <BlogItemUrl><a href="<$BlogItemUrl$>" title="external link"></BlogItemUrl>

    <$BlogItemTitle$>

    <BlogItemUrl></a></BlogItemUrl>

    </h3><Itempage>

    <Itempage></BlogItemTitle></Itempage>



    And in the code for the footer will be below:


    <Itempage><p class="post-footer">

    <em><$I18NPostedByAuthorNickname$> @ <a href="<$BlogItemPermalinkUrl$>" title="permanent link"><$BlogItemDateTime$></a></em>

    <MainOrArchivePage><BlogItemCommentsEnabled>

    <a class="comment-link" href="<$BlogItemCommentCreate$>"<$BlogItemCommentFormOnclick$>><span style="text-transform:lowercase"><$I18NNumComments$></span></a>

    </BlogItemCommentsEnabled><BlogItemBacklinksEnabled>

    <a class="comment-link" href="<$BlogItemPermalinkUrl$>#links"><span style="text-transform:lowercase"><$I18NLinksToThisPost$></span></a>

    </BlogItemBacklinksEnabled>

    </MainOrArchivePage> <$BlogItemControl$>

    </p></Itempage>

    More Blog Help Articles
    More By Codex-M


     

       

    BLOG HELP ARTICLES

    - Create a Vlog
    - Creating a Personal Blog People Actually Wan...
    - Offline Blog Managers
    - Get More from WordPress
    - Improving Blogspot Traffic with Free Google ...
    - LiveJournal: Blogs for All
    - WordPress Security Tips
    - Blogging with Yahoo
    - Sell Songs Online Safely Through Your Blog
    - Are E-Zines Still Relevant?
    - Rewriting URLs and Doing WordPress Redirects...
    - Build a Better Blog
    - Setting a Static Front or Main Page in Blogg...
    - Maximize Crawlability of WordPress Blogs and...
    - Create a Blogging Site

     
    Create the Optimal Architecture for your Critical Applications
    Warburton's the largest independently owned bakery in the UK faced a number of d....

     
    Five Best Practices for Deploying a Successful Service-Oriented Architecture
    This white paper describes the benefits you can expect with SOA, and how IBM can....

     
    Gartner Magic Quadrant for Application Delivery Controllers
    Gartner summarizes its view on Application Delivery Controllers, evaluates stren....

     
    Knowledge is Power
    What you don't know can hurt you, and is likely costing you money and increasing....

     
    Rationalizing the Multi-Tool Environment
    The rationalized multi-tool approach is flexible, scalable and cost effective. I....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek