Pages

Showing posts with label Blogger hacks. Show all posts
Showing posts with label Blogger hacks. Show all posts

Sunday, July 01, 2007

Few Blogger hacks

Nakul has asked me few questions on Blogger hacks. I will give the explanation here and hopefully it will benefit other people as well.

Hide Blogger navigation bar
Insert this in your b:skin
#navbar-iframe {
height:0px;
visibility:hidden;
display:none;
}
Use Blogger custom search engine in layout

It is important for you to hide blogger navigation bar first. I don't think you would like to see two search box in the same layout :). Put this code on anywhere where you want it to be displayed.
<form action="http://yourblogname.blogspot.com/search" id="searchthis" method="get" style="display: inline;">
<input id="b-query" maxlength="200" name="q" size="30" type="text" />
<input alt="Search" id="b-searchbtn" src="http://hafiz238.googlepages.com/search.gif" align="top" hspace="1" type="image" />
</form>
Replace yourblogname with your blog address. Maxlength refers to the maximum number of characters eg letters and numbers, that can be put into your search box. Size refers to the length of your search box. For example, the length of my search box is 30 characters. src refers to the image of search button. You can change this link to your own search button. Perhaps, you want to change the search button into a magnifying glass :).

If you would like to use standard search button, Replace this code
<input alt="Search" id="b-searchbtn" src="http://hafiz238.googlepages.com/search.gif" align="top" hspace="1" type="image" />
with this code
<input id='b-searchbtn' type='submit' value='Search' />
How to add social bookmarks
Full credits goes to Beautiful Beta. Please refer to this post for further instruction :).

How to change date header format into a date calendar icon
This hack is achieved by using an image. All my new blogger layouts have this hack. The image for this layout is this one .

If you would like to use this image for your blog, insert this code in b:skin
.date-header {
height:52px;
width:45px;
float:left;
text-align:center;
font: normal normal normal 10px/100% Arial, Helvetica, sans-serif;
padding: 22px 4px 0 0;
margin: 0 10px;
background: url('http://hafiz238.googlepages.com/calendar.gif') no-repeat;
}

Next, go to your setting tab and click formatting. Use the following options
  • Language: English (United States)
  • Date Header Format: Month Day Year. Please ensure that the month is in abbreviation form. For example 15 September 2007 will be written as Sept 15 2007.
B-)

Related post
Useful links for new Blogger

Sunday, June 10, 2007

Selective expandable post in new Blogger

At first, I try to implement the code from Blogger Help. I succeeded to establish expandable post in this blog but Read More links appear in every post, and that is annoying. I try to play around with b:if condition tags but failed eventually. I guess I do not have enough knowledge and experience with Blogger conditional tags.

My idea of using b:if tags is to create an equation. If span class id fullpost only contains "Type rest of the post here", Read More links will be hidden. If the text in the span class not equal to the default text, Read More links will appear. If I know a bit of javascript, this might help, I think...

As a final measure, I used Ramani's hack from hackosphere. It works but same problem appear again. Read More links appear in every post. Thus, I modified the code a bit. Instead of putting

span id="fullpost">Type rest of the post here</span

in the post template, I put the code manually in post editor. It works. Now, Read More links will only appear in any posts that I choose :).

UPDATE: At first it works, but later it fails miserably :-L Now, it works. The reason it failed previously is caused by putting the javascript in the body section instead of head section :)

Tuesday, May 29, 2007

Google Reader shared items hack

Google Reader allows you to show your shared items by placing the code in the blog or adding it as a blogger widget. Although there are several options available on how you can customize the shared items, basically it is not that great. You are only given the option of changing the colour of the scheme and edit the number of links shown in the blog.

I found the tips to customize the Google Reader shared items written by Andrew Grant. It was published October last year. So, I guess I'm pretty late to notice
this :). The hack is based on feedburner.

The gist of the methods are as follows:
  1. Put your Google Reader shared item feed as a new feed in the FeedBurner account.
  2. Then, click publicize tab and later click BuzzBoost.
  3. Choose any options that suits you and activate it. You can add it as a blogger widget or put the code at your blog.
  4. I prefer to put the code at the blog since I have two sidebars and several blog widgets. If I added the feed as a blog widget, it will choose the first blog widget found on the sidebar. I put Google Shared items below shoutbox.
  5. After this, check the page source generated by this feed and you can customise it by CSS. Further explanation is given here.
I will show you how do I customize my Google Reader shared items for reference. This requires basic CSS knowledge. My writing beyond this point is intended for anyone who will like to know more about hacking/customizing Google Reader shared items.


First, we need to know the generated page source. Here is a brief look at the top of shared item.


I created a new div tag with id feedburner to put the whole shared item in one place. By doing this, it will be easier to edit CSS for this shared items. Here is what I put in div.feedburner in the stylesheet.
#feedburner {
margin-top: 10px;
}

The generated page source begins with a div tag
div class="feedburnerFeedBlock"
and you can edit this div in the stylesheet :). I have adjusted the padding.
div.feedburnerFeedBlock {padding: 10px 2px 0 10px;}
Next is a p class labelled as feedTitle. This basically refers to your Feed title if you enable it in the first place. I want the title to be in black including when the mouse is hovering above the link. Here is what I've done.
div.feedburnerFeedBlock p.feedTitle {
padding: 0;
margin: 5px 0 0 0;
font-style:normal;
font-size: 13px;
font-family: Verdana, Arial, sans-serif;
text-align: left;
}

div.feedburnerFeedBlock p.feedTitle a {
text-decoration: none;
color: #000000;
font-weight: bold;
}

A shorther way of putting this is to use only B-).
p.feedTitle
Next comes the ul tag. This begin the list of your shared items. Here is what I've done.
div.feedburnerFeedBlock ul {
list-style-position: outside;
padding: 0;
margin: 0;
font-family: Arial, sans-serif;
font-size: 11px;
text-align: justify;
}

div.feedburnerFeedBlock ul a {
text-decoration: none;
color: #000000;
}

Next, I adjust the padding in the li tag by removing the list marker.
div.feedburnerFeedBlock li {background-image: none;}
After this, comes the span class labelled as headline. The name says it all. It refers to the headline of each item you shared on your Google Reader.
div.feedburnerFeedBlock li span.headline {
font-family: Arial, sans-serif;
font-size: 12px;
margin: 0;
padding: 0 0 2px 0;
line-height: 98%;
}

div.feedburnerFeedBlock li span.headline a {
text-decoration: none;
color: #2100AF;
}

What I've done is first to make the font smaller and adjust the line-spacing. I also adjusted the padding of the headline. Thus, the headline move slightly to the left compared to the feed title eg Shared items. The font colour is also changed. A shorter way instead of writing the whole div li span tag is to use only span.headline only.
Next, I edited p class for Item author and the date of the shared item.
p.feedItemAuthor {
margin: 0;
padding: 2px 0 1px 0;
}

p.date {
margin: 0;
padding: 0;
}

The actual content of the shared item is put in a div tag. Now, that div does not have any id or class associated with it. The way to edit this is to use descendant selectors in CSS. That's mean you have to locate the div tag contained in this code.
div.feedburnerFeedBlock ul li div {
color: #000000;
line-height: 110%;
padding: 0 0 0 10px;
font-family: Verdana;
font-size: 11px;
}

First, I put the name of the div which is feedburnerFeedBlock, then ul tag; followed by li and finally the actual div that we will like to customize. Pretty long isn't it ;).
Last but not least is to edit the footer. The one that shows the image from FeedBurner.
#creditfooter {
text-align: right;
color: #000000;
font-weight: normal:
font-size: 10px;
}

#creditfooter a:hover {
background-color: transparent;
}

That's the end of this long post :D. Just before you ask me anything about CSS, please note that I only know a few bit about CSS. I learned CSS whenever I have free time. Thanks.

Monday, May 28, 2007

feedburner and smilies

This blog layout has been improved with two new features.

Feedburner
I managed to direct all the blog's feed into one single feedburner feed. Now whenever you click the RSS feed on the browser address bar (the one in orange icon), you will be automatically subscribe to my Feedburner Feed. Thanks for Feedburner forum for showing the way to achieve this.

Now, come the hack for blog feed B-). The usual blogger feed is based on the updated post. This means that if I edited an old post, this post will come at the top of my feed. The usual case for this to happen is when I labelled my old post. This is quite annoying and I wish the feed is based on when the post is published not when the post is updated. Thanks to phydeaux3, now the problem is solved :). Now, hopefully, you will only see the post according to the published date.

Smilies
Blogger does not support any emoticon/smilies icon in their service. Blogspot users have to find ways to put the smilies in their post. There are many ways that I found on the internet. Currently I am using Deepa's method which will show you Yahoo! emoticons :).