Sunday, November 27, 2011

Blogger Magic - A Static Home Page

Every week, somebody asks for such a simple blog feature.
How do I have a single blog post always displayed, for the home page?
There are many things that Blogger has yet to provide, and this is one. A blog, by definition, contains a dynamic home page, with the most current posts displayed.

Today (sorry, too late!), if you view this blog, this post will be displayed, at the very top of the home page. Tomorrow, this post will be displayed, just not at the top of the home page. In a couple weeks, this post will not be displayed on the home page, at all. That is how blogs work. If you want to display anything else, you don't have a blog.

That's the purist position, anyway. A blog is simply a web site with the latest posts displayed on home page (the main page), and hidden older posts (the archives).


(Update 2012/06/06): The recent "Search preferences" feature allows us to setup a true static home page, with none of the complications below.
The neat thing about this magic trick is that it's not difficult to make it work. I categorise this trick as a snake, after the old taunt from my mother
If it had been a snake, it would have bitten you.

It's so simple, really.
  1. Make the blog not display any posts, for home page.
  2. Add a text gadget.
  3. Tweak the text gadget to only display, when home page URL is displayed.
  4. Use the Pages gadget, and index the rest of the blog. Add links using various label searches, pages, and posts, as you like.

Make The Home Page Not Display Any Posts
If you make the main page not display any posts, you get an empty home page. Settings - "Posts and comments" contains the "Show" setting. Set "Show" to "0 posts", and the blog has an empty home page.

Add A Text Gadget
Add an HTML / Text gadget, positioned just above or below the "Blog Posts" gadget. Setup the new gadget just like the blog post, that you would want permanently displayed. If you want to use the post editor to compose the gadget, do that.

Tweak The Template
This is the one part of this project, that requires any technique. Use the Template Editor, and edit the gadget template, for the gadget that you just added, so the gadget only displays when the home page URL is being displayed.

Use The Pages Gadget, To Index The Rest Of The Blog
Once you have a static home page gadget, just add links to the rest of the blog. You can have links in the new gadget - and you can have an index in the blog header, or in the sidebar. Use your imagination here, it's your blog.

That's it. Really.

>> Top

Elm0D

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment

Navigate» Become author for this Blog

Manual Categories