Monday, March 11, 2013

Structure of Blogger Template




This is first part of series Create Your Own Blogger Template. In this part we learn structure of blogger template. So lets begun.
Our ordinary website template is used HTML language to design, but blogger template uses XML language to design. Structure of blogger template is same as structure of HTML file, which contains header ans body section which are enclosed into HTML under the XML tag.

<?xml version="1.0" encoding="UTF-8" ?>
<html>
    <head>
    ....
    <b:skin>
      <![CDATA[
  
      ]]>
    </b:skin>
    ....
    </head>
    <body>
    ....
    </body>
</html>
Head section contains all the meta tag information, css and Blogger variable.
  • Meta Tag : Meta tag information used for search engine optimization purpose, which include all title, description, keyword, author etc. included.
  • CSS :  CSS is used for designing purpose, changing to font style, size, color will be handled in this section. All the CSS code must be written between
    <b:skin><![CDATA[   
    and
    ]]></b:skin>
    Our blogger template is in XML format and css format is not in XML format, may be interrupt the parsing since css code enclosed into CDATA. When blogger template execute,
     <b:skin>..</b:skin>
    is converted into
     <style type="text/css">..</style>
    and
     <![CDATA[...]]>
    converted into comments
  • Blogger variable : Blogger variable is used for creating interface between our template and Blogger Template Designer. See Details into How to make Custom Template into Blogger Designer Friendly Template.
Body Section contains an designing layout of blog, means 1 column ,2 column, 3 column, right sidebar, left sidebar, ... . Below showing some blogger layout design.



Blogger template layout contains mainly four parts,
  • Header
  • Body
  • Sidebar (left or right or both)
  • Footer
Layout of blogger template is build using an section, widget. So first we learn what is section and widget in blogger.


Section is element which indicate part of layout like header, content, sidebar and footer and within section you can add multiple widget like blog archive, blog roll, or event third party HTML/JavaScript code. You can customize look and feel of section using CSS wrapped around it.
Syntax of section look like this

<b:section id='header' class='header' maxwidgets='1' showaddelement='no' growth='vertical'>
</b:section>
Where
  1. id is required field, it is unique id provide to that section for identification, use alphanumeric for given id.
  2. class is optional field, may be given an common name like header, main, sidebar and footer. You can given different name as you want.
  3. maxwidgets is optional field, specify that how many maximum widget are inside that section.
  4. showaddelement is also optional field, which specify in layout management in blogger, there will be show an "Add a Gadget". yes or no value are specify for this attribute, yes is default value.
  5. growth is also optional field, which indicate that if gadget is add, then sequence of adding gadget is vertical or horizontal. vertical is default value.
Widget, as display in above pic, widget added into section, there may multiple widget inside on section. Extra code can not be added directly inside section, for that widget used, code added inside widget and widget added inside section. Syntax of widget as follow
<b:widget id="header" type='Header' locked="yes" > 
</b:widget>
Where
  1. id is unique and alphanumeric, Once assign id can't be changed, until delete or add new one.
  2. type is also required field, which one of the following,
    • BlogArchive
    • Blog
    • Feed
    • Header
    • HTML
    • SingleImage
    • LinkList
    • List
    • Logo
    • BlogProfile
    • Navbar
    • VideoBar
    • NewsBar
  3. locked specify that, you can move widget using page element tab in blogger. If yes then can't move, that widget locked. If no then you can move this widget. Default value is no.
  4. title is specify name of that widget.
  5. pageType specify that on which type of page this widget is display. It can be all, archive, main or item. all is default value.
  6. mobile is indicate this widget is display in mobile view or not.


Tag :
Share this Post :
Author Image
  • Facebook
  • Twitter
He is owner of GrowTechInfo.com from Pune, INDIA. He is passionate about blogging. He is a Computer Engineer, Professional Blogger & an addicted Web Developer.know more..
back to top