Monday, July 29, 2013

Basic blogger template : just posts, absolutely minimum

Here's a basic form of blogger template that you can use to build other advanced template. I always wanted to bake my own custom themes and templates for blogger but there's no official documentation - actually there are but not that developer friendly ! Further, inspecting existing template source code it is very hard to derive what follows. I mean, there are definitely rules and syntaxes to follow in blogger template but looking at any downloaded template can be intimidating to beginners.

So, this is very minimal template i'm presenting here. Make template a xml doc, inspect header and meta tags. All CSS style rules inside - under CDATA (it's xml). And minimum requirement for a blogger template is there should be at least one b:section This basic template has one section which includes a blog posts widget. To learn more about how sections / widgets work together please refer to links at footer.

Notes for further work:  

1) JS can be troublesome. If nothing worked encode it or put the whole content inside script into CDATA.
2) Images needs to be hosted. 

3) All CSS needs to be in one page or host it somewhere separately.
4) All JS needs to be in one page or host it somewhere separately.
5) Imagine different kind of "page" types and different kind of layout / templates you'd like to render depending upon different URLs, and imagine all of this to be done in single page XML file. Holy Shit ! There sure gonna be loads of if and else blocks if this has to be achieved in one page.

Enjoy. And if this work helped you get started in developing/designing blogger templates, don't forget to link my gist or this post in your website somewhere :) i'd be glad.

Grab code from gits:
Template Code Below:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html expr:dir='data:blog.languageDirection' xmlns='' xmlns:b='' xmlns:data='' xmlns:expr=''>

<b:include data='blog' name='all-head-content'/>
<link expr:href='data:blog.url' rel='canonical'/>

<b:if cond='data:blog.pageType == &quot;index&quot;'>
<b:if cond='data:blog.pageType != &quot;error_page&quot;'>
 <title><data:blog.pageName/> - <data:blog.title/></title>
 <title>404 - <data:blog.title/></title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="Semicolon developers, semicolon languages, semicolon technologies, semicolon software, developers network, network professionals, web development nepal, software development nepal, offshore development nepal, outsourcing nepal, web development kathmandu, software development kathmandu, offshore development kathmandu, outsourcing kathmandu, computer courses in kathmandu, PHP course , JavaScript course, android course, " />
<meta name="description" content="Semicolon developers network pvt. ltd. is an Android and web application development company in Kathmandu, Nepal. We can be your next IT development partner." />
<!-- You May Not Share any of these codes unless giving credits to Technolies blog -->
    <b:if cond='data:blog.pageType == &quot;archive&quot;'>
     <meta content='noindex,noarchive' name='robots'/>

Blogger Template: Semicolon Developers
Template By:      Bhupal Sapkota
Date:             29 July 2013
----------------------------------------------- */
html, body{




<b:section class='main' id='main' showaddelement='yes'>
<b:widget id='Blog1' title='Blog Posts' type='Blog' locked='false'>

<b:includable id='main' var='main'>

  <!-- blogposts -->

    <b:loop values='data:posts' var='post'>
      <b:include data='post' name='post'/>

   <!-- navigation -->
  <b:include name='nextprev'/>


<b:includable id='post' var='post'>
  <div class='post'>
    <a expr:name=''/>

    <b:if cond='data:post.title'>
     <b:if cond=''>
        <a expr:href=''><data:post.title/></a>
        <b:if cond='data:post.url'>
          <a expr:href='data:post.url'><data:post.title/></a>

<div class='post-meta'>
Posted by  <>, <data:post.dateHeader/>



<b:includable id='nextprev'>
    <b:if cond='data:newerPageUrl'>
      <a expr:href='data:newerPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-newer-link&quot;' expr:title='data:newerPageTitle'>&#171; <data:newerPageTitle/></a>    

    <b:if cond='data:olderPageUrl'>    
      <a expr:href='data:olderPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-older-link&quot;' expr:title='data:olderPageTitle'><data:olderPageTitle/>  &#187;</a>    

    <b:if cond='data:blog.homepageUrl != data:blog.url'>
      <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>
      <b:if cond='data:newerPageUrl'>
        <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>






Official Reference from Blogger:
Advance Use:
Next Level tips:

Follow these in order:


© 2013 Echo "Semicolon Developers"; Kathmandu. All rights resevered @ Semicolon Developers Network Pvt. Ltd.. Designed by Templateism

Back To Top