Wednesday, February 27, 2013

The Simplest Possible Template

I like to start from the very beginning. So, I wanted to start my template experimentation with a very, very basic template. Following is what I started with.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html
b:version='2'
class='v2'
expr:dir='data:blog.languageDirection'
xmlns='http://www.w3.org/1999/xhtml'
xmlns:b='http://www.google.com/2005/gml/b'
xmlns:data='http://www.google.com/2005/gml/data'
xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible'/>
<b:skin>
<![CDATA[/*
-----------------------------------------------
----------------------------------------------- */
]]>
</b:skin>
</head>
<body>
<b:section class='main' id='main' showaddelement='yes'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
</body>
</html>


I was able to copy-and-paste this directly into Notepad++, save as an XML file, and upload to Blogger using the Backup / Restore button (upper right hand corner on the Template page) and it worked for me.

I think this bare-bones template is helpful because it lets you see the basic structure of a Blogger template:
  • There is an HTML element that contains two child elements - <head> and <body>. The opening HTML tag has a series of required attributes. You should just copy-and-paste these directly. It's not very important to know exactly what these are. 
  • The <head> element contains two elements - a <meta> element and a <b:skin> element. You won't have to worry about the <meta> element for a while. The <b:skin> element is where variables and CSS styling will eventually go - but I'll get into that in another post. 
  • The <body> element has one child - <b:section>. Every Blogger template MUST have at least one <b:section> element.
  • The <section> element has one child - <b:widget>. The widget, in this case, is a Blog widget (as indicated by type='Blog').
And with that, we have a very simple Blogger template. 

No comments:

Post a Comment