Archived Post: My First Blogger Template Attempt

Dear Friend,

I'm happy to announce my first hack that I improved based on the original hack from Hackosphere (http://hackosphere.blogspot.com/). Many thanks to Mr. Ramani for his hacking ability and his willingness to share with the rest of us.

My hack is based on his hack of showing the "titles only" if you click on a monthly or label listing. Instead of showing the content of all the posts, it'll only show the titles. My improved hack is based upon that by not even showing the date that a post is created, and I also make the posts indented as a nice bulleted list (that you can use CSS to change its appearance, btw.)




Below is the complete code of the hack. I also fixed the bug of the date not showing up in the Main Page / and the Main Page not lined up with the latest comments/posts - Thanks a bunch Vivek/ you're a great tester! pls see the line that is bold, and two other ul tags being commented out at front and back. (7 Sep 06)


 <!-- posts -->
  <!-- <ul>-->
 <div id='blog-posts'>
   <b:loop values='data:posts' var='post'>
   <!--Improved hack from Hackosphere By: Hoctro http://hoctro.blogspot.com - 6 Sep 2006 -->
   <!-- This hack allows posts to be shown without dates and as a bullet list -->

       <b:if cond='data:post.dateHeader'>
         <b:if cond='data:blog.pageType == "item"'>
           <h2 class='date-header'><data:post.dateHeader/></h2>
         </b:if>
         <!--Fix Bug for not showing the date on main page - 7 Sep 2006 -->
         <b:if cond='data:blog.homepageUrl == data:blog.url'>
           <h2 class='date-header'><data:post.dateHeader/></h2>
         </b:if>
       </b:if>

     <!--Hack by Hackosphere - 6 Sep 2006 -->
     <b:if cond='data:blog.homepageUrl != data:blog.url'>    
       <b:if cond='data:blog.pageType != "item"'>        
           <ul><li><a expr:href='data:post.url'> <data:post.title/> </a></li></ul>
 <b:else/>        
          <b:include data='post' name='post'/>    
        </b:if>
          <b:else/>    
       <b:include data='post' name='post'/>
     </b:if>
     <!--End of Hack by Hackosphere - 6 Sep 2006 -->
   
     <b:if cond='data:blog.pageType == "item"'>
       <b:if cond='data:post.allowComments'>
         <b:include data='post' name='comments'/>
       </b:if>
     </b:if>
   <!--End of Improved hack from Hackosphere By: Hoctro  -->
  <!-- </ul>-->
   </b:loop>
 </div>



Basically, you need to replace the <div id='blog-posts'> portion with the code above. Also, the original hack is here, please refer to it on how to hack the relevant portion.



I predict it's gonna be very much fun hacking Blogger, since the new way of hacking is very much like XSLT, the one I am already familiar with. It's actually much simpler than XSLT, as far as I can tell. I hope I will have many more hacks to share with you in the future.

Thanks for your time and have a nice day!

Hoctro (9/2006)
Blog: http://hoctro.blogspot.com/