Create your own blogger template from scratch -1
Create a demo blog in blogger:
Here in this post we’ll create a blogger template from scratch. First make a demo blog and change it’s visible settings to private. You can do so by going to the dashboard of your new demo blog then go to Settings >> Basic >> Permissions >> Blog Readers. Set it to Private. Then write some 4 or 5 posts. Now we’ll create a xml file in our computer which will be our blogger template.
Create a new xml file for blogger template :
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html 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='width=device-width' name='viewport'/>
<b:include data='blog' name='all-head-content'/>
<!-- title of the page -->
<b:if cond='data:blog.pageType == "index"'>
<title><data:blog.pageTitle/></title>
<b:else/>
<title><data:blog.pageName/> | <data:blog.title/></title>
</b:if>
<!-- Put your css style here. -->
<b:skin><![CDATA[
.wrapper{
width:960px;
margin:0px auto;
}
.header{
width:100%;
height:130px;
}
.menu
{
width:auto;
height:38px;
float:right;
}
.blogcontent{
width:100%;
}
.leftcol{
width:68%;
height:500px;
float:left;
}
.rightcol{
width:32%;
height:600px;
float:right;
}
.footer{
width:100%;
height:60px;
background-color:gray;
text-align:center;
padding-top:10px;
}
.clear{
clear:both;
}
]]></b:skin>
</head>
<body>
<div class='wrapper'>
<div class='header'>
<header>
<b:section class='header' id='header' maxwidgets='1' showaddelement='no'>
<b:widget id='Header1' locked='true' title='' type='Header'></b:widget>
</b:section>
</header>
</div><!-- end Header div -->
<nav class='menu'><!-- your menu --></nav>
<div class='blogcontent'>
<div class='leftcol'>
<b:section class='main' id='main' preferred='yes' showaddelement='no'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'>
</b:widget>
</b:section>
</div><!-- end mLeft div -->
<div class='rightcol'>
<b:section class='sidebar' id='sidebar' preferred='yes' showaddelement='yes'>
</b:section>
</div>
<div class='clear'></div>
</div>
<footer class='footer'> your Footer info</footer>
</div>
</body>
</html>
Here at the very top is the xml declaration , then HTML 5 declaration and then there is the Blogger related namespaces.These namespaces are like backbones because they provide the basic functionality and data fetching. Now in the head part we have included the blog so that we can fetch information about the blog, in this case we want to show the title of the blog as the title of the webpage. If it’s our homepage then the page’s title will be the Blog name. And if we are on any post or “item” of our blog then the page title will be the title of the post followed by the blog name for example :” This is post | My Blog name”. For this we have used the if-else statement. What it’s basically doing is only checking if the pagetype is “index” ( means homepage ) then display blog Title or else display the post title followed by blog title.
After the title there is skin tag. This the place where we put the css style for our blog. Here i have added some codes which gives a basic layout to our blog. We’ll add more codes as we’ll go through this tutorial.
The <body> area :
Also our header section has a attribute maxwidgets=”1″. This is used to set the maximum number of widgets a section can have. This means that our header section can have only one widget. Setting showaddelement=”no” means we’ve disabled the widget adding option.
Thanks a lot bro
Thank you Vishal. Hope this post helped you. 🙂
Thank you Very Much Bro 🙂 It’s Very Usefull 😀 😉