Understanding Blogger Template - 3

Feb 5, 2009

The blogger template is a xhtml document which is rendered based on variables. These tutorials aims at helping to understand the blogger template and hence to experiment, learn and change it. Blogger template has mainly three types of variables one which controls the flow of the code, one which pulls data from the databases behind and the third are expressions. This variables are then distinguished with the help of following xml namespaces.

This is third in the series of the three tutorial for Blogger Template and deals mainly with the explanation of the expr: namespace and understanding its usage. The other tuts are:

  1. Blogger Template Explanation - Sections, widgets, includables, includes. b: namespace

  2. Blogger Template Explanation - Data access. data: namespace elements.

  3. Blogger Template Explanation - How to use expr: namespace - customize links.

Expr namespace is simple but its usage is very important. Expr is basically used in conjuction with data tags. For making the blogger engine aware that the xml tag attributes coming next are having data tags in them and have to be parsed. Whenever there is a tag say anchor tag, you will have attributes like href and in that case you want the href link created dynamically with help of some data say data:post.url then you will have to use href as expr:href.

Simple implementation of expr:href in the title includable.

This includable is the title section of your blog. Check the usage of expr:href with the anchor tag.

<b:includable id='title'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<a expr:href='data:blog.homepageUrl'><data:title/></a>

See this code below for understanding the implementaion of expr:src and over other such tags. It is being used for parsing the data tags in image img tag attributes.

<a expr:href='data:blog.homepageUrl' style='display: block'>
style='display: block'

As you can see how expr tag is applied to the attributes selectively. Wherever data was to be used expr is applied and in style where data tag is not required the expr is ommitted. Therefore the expr namespace variables are all the attributes which might have some data namespace variable inserted in it. So use expr for data tags used in any attribute values like expr:title, expr:id, expr:onClick and so on. These attributes can be for any xml tag. I have seen it in anchor a, image img, span, div, select, input, button etc., so pretty much everything.

Example Social Bookmark StumbleUpon button for Blogger.

This code listing below explains how to insert stumble upon button for blogger. Although it serves as an example on how to do this but my main focus here is on the usage of quotes. So check how the single and double quotes are used in expr:href for creating and using the url to submit and/or thumbs up the specific post correctly. It generally does not matter that you are using single or double quotes, but when your attribute has to use both of them single quotes decide the attribute opening and closing and double quotes are understood as part of attribute.

Blogger uses single quotes for attribute values, and double quotes within, so change your code as necessary. Within the attribute value, if there are extra single or double quotes as part of the original code, e.g. Javascript, you need to escape them. Also check that the ampersand '&' is converted to '&amp;'. So you might have to create your url in this way. Check more on the stumble upon post url on their site StumbleUpon http://www.stumbleupon.com Widgets and button section.

expr:href='"http://www.stumbleupon.com/submit?url=" + data:post.url + "&amp;title=" + data:post.title'

Example Social Bookmark - Add Digg to Blogger

Again although the below code listing is an example of Adding Digg to Blogger template, my focus here is on the escaping done while using javascript. Check how data:post.url is used while inserting it in the javascript variable digg_url. You can use this code to display a counter of diggs done for your post in a neat compact manner on your blog. Check out the digg documentation of this on the http://www.digg.com tools section.

<script type="text/javascript">
digg_url = &#39;<data:post.url/>&#39;;
digg_skin = 'compact';
digg_window = 'new';
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

So as you saw proper escaping of quotes is done above. Although this is not direct example of the expr: tag usage as javascript onclick or anyother such event is not used here. But you got the logic right? But if you didn't check this code listing displaying the button to add comments. This is generally found in the footer section of your post and its obviously customisable :).

<div class='post-footer-line post-footer-line-3'>
<span class='post-comment-link'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:post.allowComments'>
<b:if cond='data:post.numComments == 1'>
1 <data:top.commentLabel/>
<data:post.numComments/> <data:top.commentLabelPlural/>

The data:post.addCommentOnclick generates appropriate javascript based on your blog setting for example a popup window or comment post page. And data:post.addCommentUrl will generate the url pointing to the comments for the post.

This comes to the end of the three tutorials which I was intending to write on the blogger template. But If you want anything else to be added in this tutorial series let me know and I will do it.

If you have done anything interesting with the blogger template create a back-link to it in this tutorial. Please share you comments about the things discussed and add information that you feel will benefit others. Thanks for reading.
Understanding the Blogger Template - 2

Jan 26, 2009

The blogger template is a xhtml document which is rendered based on variables. These tutorials aims at helping to understand the blogger template and hence to experiment, learn and change it. Blogger template has mainly three types of variables one which controls the flow of the code, one which pulls data from the databases behind and the third are expressions. This variables are then distinguished with the help of following xml namespaces.

This is second in the series of the three tutorial for Blogger Template and deals mainly with the explanation of the data: namespace and understanding how to access its vars.

  1. Blogger Template Explanation - Sections, widgets, includables, includes. b: namespace

  2. Blogger Template Explanation - Data access. data: namespace elements.

  3. Blogger Template Explanation - How to use expr: namespace - customize links.

Data namespace contains the most important tags as this is the way you access your data. Maybe I would write a separate blog for this one, but the basics are here. The namespace is basically a way to identify and maintain uniqueness in when large number of elements are present. The expression for identifying a element uniquely in xml documents is as in [namespace-identifier]:[the-tag]. The data here is the namespace identifier and have further unique elements. A namespace basically helps in identifying or giving a variable unqiue name.

There are many types of data variables. Some of them are available globally. By globally I mean they can be accessed anywhere whereas the certain tags/identifiers can only be accessed from certain widgets. That is how it works.

The Globally available data in Blogger template

This data is available everywhere in your page. So use it wherever you like. These are referenced as part of the "blog" data, i.e., to be used as blog.title for referring for the title of the blog. Don't forget to include the namespace data in the begining. This code listing will explain the usage.

<!--[The blog's title.]-->

The type of the current page. One of 'item', 'archive', or 'index'.
This var is quite useful for selectively showing content on
different type of pages. Put an if and check if its index page or
item page and then display selective content

<!-- [The URL of the current page.] -->

<!-- [The homepage of the blog.] -->

The title of the current page. This is often the blog title,
but may contain additional information on archive or post pages.

<!-- [The encoding to use for the blog, e.g. UTF-8.] -->

Either "ltr" or "rtl" for left-to-right
and right-to-left languages, respectively.

<!-- [The autodiscovery feed links for the page header.] -->

Apart from the data available globally there is data specific to specific widget types. Following is the list of widget types. For each of this widget there are different tags available and locally for each one.

  1. Page Header

  2. Blog Archives

  3. Profile

  4. Text / HTML / JavaScript

  5. Feed

  6. Picture

  7. Labels

  8. List

  9. Link List

  10. Logo

  11. Blog Posts

Page Header widgets in Blogger template

This is basically used in the header section of your blog entry. Where the title and the description of the blog is given. This widget is a very simple one and has only two types of data variables for access. Note these don't require the usage as blog.identifier as in case of globally available data. This can be referenced directly in the Page Header type widget.

<!--[The blog's title. ]-->

<!-- [ The blog's description. ]-->

Blog Archives in Blogger template

There are three types of display formats of blog archives- Menu, Flat and Hierarchy. If you're designing a new version, it's easiest to use 'FLAT' as the style, and then manipulate the rest of the data as desired. The key data are title, style and data . Data containing: the name of the archive duration; url of the posts; and post-counts in the duration.

  1. title The title of the widget.

  2. style One of 'MENU', 'FLAT', or 'HIERARCHY'.

  3. data A list of each archive unit, each of which contains:

    1. name: The name of this archive interval or period.

    2. url: The link to the page containing posts from this interval.

    3. post-count: How many posts there are in this interval.

Usage: Check the includable for flat. This can then be included as include in the main includable for display.

<!--[ Simple usage of title ]-->
<b:if cond='data:title'>

<!--[ For a includable flat type ]-->
<b:includable id='flat' var='data'>
<b:loop values='data:data' var='i'>
<li class='archivedate'>
<a expr:href='data:i.url'>

Profile Widget in Blogger template

This is the profile of the author. There can be one author of a blog or maybe the blog has a team of authors. For a blog with a single author, the profile widget contains the following information.

  1. title The title of the widget.

  2. userUrl The author's profile URL.

  3. location The location from the author's profile.

  4. aboutme The "About Me" information from the profile.

  5. displayname The author's display name.

  6. photo The user's profile photo, made up of the following:

    1. url: The photo URL.

    2. width: The photo's width, in pixels.

    3. height: The photo's height, in pixels.

    4. alt: The "alt" text for the photo.

Team blog widgets contain less information compare to single blog widgets. The tags are:

  1. title: The title of the widget.

  2. authors: The list of all authors, each of which contains the following:

    1. displayname: The author's display name.

    2. userURL: The author's profile URL.

If you want to design your template to handle both single- and multiple-author blogs, you can use the data:team variable to distinguish between the two cases as shown below.

<b:if cond='data:team=="true"'>
<!--[display multiple authors] -->

Text / HTML / JavaScript Widget in Blogger template

HTML / Javascript and Text widgets are very simple widgets and contain only two data elements.

  1. title: The widget's title.

  2. content: The content of the widget.

Usage of title and content is similar in all widgets (refer Archives code usage above).

Feed Widget in Blogger template

Feed widget like any other widget has tags for accessing its own information and along with that has feedData. This feedData contains all items in the feed. items being like title, published date, author, summary etc. So basically this feedData is a set of data. You may now have remembered the loop tag (check the previous tut in the series), we have to use that to access each item from the set of items.

  1. title: The widget's title.

  2. feedUrl: The URL of the feed.

  3. feedData: The items in the feed, each of which contains:

    1. title: the item title.

    2. str_published: When the item was published (nicely formatted in blog's timezone).

    3. published: When the item was published (in seconds since epoch).

    4. str_updated: When the item was last updated (nicely formatted in blog's timezone).

    5. updated: When the item was last updated (in seconds since epoch).

    6. author: The item's author.

    7. summary: A snippet from the item, if available.

    8. alternate: Where to get more information about this item, which contains:

      1. href: The permalink of this item.

      2. type: The content-type of this item.

Picture Widget in Blogger template

A picture widget contains a single image, and provides all the relevant data for that image.

  1. title: The title of the widget.

  2. sourceUrl: The URL of the image.

  3. width: The image's width, in pixels.

  4. height: The image's height, in pixels.

  5. caption: The image caption.

Labels Widget in Blogger template

The labels widget includes a list of all labels that are in use on the blog.

  1. title: The widget title.

  2. labels: The list of labels, each of which contains:

    1. name: The text of the label.

    2. count: How many posts have this label.

    3. url: A link to a page displaying posts with this label.

List Widget in Blogger template

The simplest form of a list. Each item is just a single piece of text, without any different types of data within it.

  1. title: The widget title.

  2. items: The list of items.

Usage: Similar to link list below.

Link List Widget in Blogger template

A slightly fancier list, where each item has two parts to it: the text and the link.

  1. title: The widget title.

  2. links: The list of links, each of which contains:

    1. name: The link's text.

    2. target: The link's URL.


<!--[Check the complete implementaion of the linklist widget. ]-->
<b:widget id='LinkList1' locked='false' title='More Blogs' type='LinkList'>
<b:includable id='main'>
<b:if cond='data:title'>
<div class='widget-content'>
<b:loop values='data:links' var='link'>
<a expr:href='data:link.target'>
<b:include name='quickedit'/>

Logo in Blogger template

It doesn't get any simpler than this one. Just one piece of data here.

  1. fullButton: The URL of the Blogger button you've selected.

Blog Post Widget in Blogger template

This is the central part of any blog, and the most complex. You should definitely consider simply making modifications to one of the default templates before writing a blog posts widget from scratch. But however you want to do it, here's all the data available in this widget.

  1. feedLinks: A list of feeds for this page. On the main page, this will contain the main blog feeds; on item pages, this will also contain comments feeds. The blog post widget has a includable created as feedlinks, which in turn uses another includable feedlinksbody. Each item in this list contains the following:

    1. url: The feed URL.

    2. name: The feed name (i.e. 'Posts' or 'Comments').

    3. feedType: The type of feed (Atom or RSS).

    4. mimeType: The mime type of the feed.

  2. olderPageUrl: If there are older posts than the ones on the current page, this is a URL to those posts. Context-sensitive for page type. (Not all pages will have this link. use if)

  3. olderPageTitle: Title of the link to the older page of posts.

  4. newerPageUrl: The newer equivalent of olderPageUrl.

  5. newerPageTitle: The newer equivalent of olderPageTitle.

  6. commentLabel: The phrase to use to show the number of comments, e.g. "comments."

  7. authorLabel: The phrase to use to indicate who wrote the post, e.g. "posted by."

  8. timestampLabel: The phrase to use to indicate when the post was written, e.g. "posted at."

  9. postLabelsLabel: Phrase to introduce the list of post labels, e.g. "labels for this post."

  10. backlinksLabel: Phrase to describe backlinks to this post, e.g. "links to this post."

  11. posts: A list of all posts for this page. Each post contains the following:

    1. dateHeader: The date of this post, only present if this is the first post in the list that was posted on this day.

    2. id: The numeric post ID.

    3. title: The post's title.

    4. body: The content of the post.

    5. author: The display name of the post author.

    6. url: The permalink of this post.

    7. timestamp: The post's timestamp. Unlike dateHeader, this exists for every post.

    8. labels: The list of the post's labels. Each label contains the following:

      1. name: The label text.

      2. url: The URL of the page that lists all posts in this blog with this label.

      3. isLast: True or false. Whether this label is the last one in the list (useful for placing commas).

    9. allowComments: 'True' if this post allows comments.

    10. numComments: The number of comments on this post.

    11. showBacklinks: Whether to show backlinks for this post.

    12. numBacklinks: Number of backlinks for this post.

    13. addCommentUrl: The URL of the 'add a comment' form for this post.

    14. emailPostUrl: The URL of the 'email this post' form for this post.

    15. editUrl: The URL of the edit form for this post.

    16. feedLinks: A list of feeds specific to this post. (This is different from the overall blog feedLinks, as it may contain a feed for the post's comments, for instance.) Each contains the following:

      1. url: The feed URL.

      2. name: The feed name (e.g. 'Posts' or 'Comments').

      3. feedType: The type of feed (Atom or RSS).

      4. mimeType: The mime type of the feed.

    17. comments: A list of all comments for this post (on item pages only). Each contains the following:

      1. id: The numeric ID of the comment.

      2. body: The body of the comment.

      3. timestamp: The time the comment was created.

      4. author: The display name of the comment's author, or 'Anonymous'.

      5. authorUrl: URL of the comment author's profile, if the comment is not anonymous.

      6. deleteUrl: The URL for deleting this comment.

      7. isDeleted: Whether this comment has been deleted. (The text of deleted comments is replaced with a placeholder.)

<!-- [Using feedlinks ]-->
<!-- [feedlinks for the blog can be used displayed using the elements in this way. ]-->
<!-- [whereas feedlinks for a post which include e.g. comments can be shown this way. ]-->

if inside a includable and a var is assigned to it while using the include
then use it in this manner
<b:include data='post.feedLinks' name='feedLinksBody'/>
<b:includable id='feedLinksBody' var='links'>
<b:loop values='data:links' var='f'>
<a class='feed-link' expr:href='data:f.url' expr:type='data:f.mimeType'>
<data:f.name/> (<data:f.feedType/>)

So from the above list the data elements which are in the main list can be accesed directly like in case of blog feedlinks above. The sub-lists to the main can be accessed using the dot operator i.e., similar to object oriented programming where the [classNameVar].[objectVar] gives you access to the object variable of a class. So to access variables deeper in the list keep using dot operators.

For accessing the comment id you will have to use either the
includable method shown previously or use this one.
<!-- [but you should use includable as they are cool :) ]-->

Sometimes when you try to use this data elements directly it gives error. Either your widget / section won't work or something like that would happen. One of the reasons is that you can't use this expressions directly. You have to use the expression namespace which I have introduced you in the previous tutorial. As the tutorail on data namespace has already got to big. I will continue the expr:[vars] namespace in the next tutorial. Althought I guess that won't be this big :).

I have tried to explain a lot of things here. But if you want or have a better explanation add it up in comments. If you have any doubts put them here would answer them if I know :). Let me know thy feedback.

Understanding the blogger template - 1

Jan 24, 2009

The blogger template is a xhtml document which is rendered based on variables. These tutorials aims at helping to understand the blogger template and hence to experiment, learn and change it. Blogger template has mainly three types of variables one which controls the flow of the code, one which pulls data from the databases behind and the third are expressions. This variables are then distinguished with the help of following xml namespaces. This one is the first in series of three tutorials.

This tutorial will mainly concenterate on the template basics and the b:namespace. The index for all tuts:

  1. Blogger Template Explanation - Sections, widgets, includables, includes. b: namespace

  2. Blogger Template Explanation - Data access. data: namespace elements.

  3. Blogger Template Explanation - How to use expr: namespace - customize links.

Before you start experimenting with your blogger template I will suggest you do two things. Create a sandbox blog which you should delete once you are done experimenting, so that the url is free for some other poor blogger. Now Download the current template of your blog i.e., you should backup both your widgets and the template file itself. You can search for how to do this on google or wait until I write one tutorial on that :).

To understand/experiment with your blogger template I will suggest don't do it on your blogger "Edit HTML" page. Use the template that you downloaded with some advanced text editor. I would recomment Notepad++ but you can use whatever you like to understand your blogger template.

The blogger template is a xhtml document based on http://www.w3.org/1999/xhtml specification. The following namespaces are used in the blogger template:

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'

These namespaces will be used throughout the xml document to fetch and display data. So this tutorial is going to explain mainly the variables in the 'b' namespace. The variables in this namespace mainly control the layout and control flow of the template. This helps in placing the elements on your blog at certain location and if-else conditions as well as loops. More about the namespaces later.

The template is mainly divided in sections. This sections will include widgets. Widgets will have includables. includables are useless unless you use it by using the include tag.

The Section Tag.

Section tag determines the division of your blogger layout. The section cannot contain any code directly. Only widgets are to be inserted inside it. Following is the format and attributes are supported by the section tag.

<b:section [attribs] >

  1. id (Required) A name identifying the section must be unique. This id can be used to identify the section after the blogger rendering is done. These section tags will show up as div tags having the same id.

  2. class (Optional) Common class names are 'navbar,' 'header,' 'main,' 'sidebar,' and 'footer.' If you switch templates later, these names help Blogger determine how best to transfer over your content. However, you can use different names, if you like. You can use them to stylize your content.

  3. maxwidgets (Optional) The maximum number of widgets to allow in this section. If you don't specify a limit, there won't be one.

  4. showaddelement(Optional) Can be 'yes' or 'no,' with 'yes' as the default. This determines whether the Page Elements tab will show the 'Add a Page Element' link in this section.

  5. growth (Optional) Can be 'horizontal' or 'vertical,' with 'vertical' as the default. This determines whether widgets within this section are arranged side-by-side or stacked.

The Widget Tag.

Widget Tags are included inside section tags. There are two ways of viewing the html code on the "Edit HTML" page. One is simple form which gets displayed by default. The other is by using the "Expand Widgets" checkbox. In the simple form the widgets are included inside the sections with the single tag format i.e., opening and closing tag in one.

<!--Simple form.-->
<b:widget [attribs] />

<!-- Expanded form. -->
<b:widget [attribs] >

A widget may have the following attributes:

  1. id (Required) May contain letters and numbers only, and each widget ID in your template should be unique. A widget's ID cannot be changed without deleting the widget and creating a new one. Similar to the section tag's id, widget tags also get converted to div tags having the id same as used here.

  2. type: (Required) Indicates what kind of a widget it is, and should be one of the valid widget types listed below.

  3. locked: (Optional) Can be 'yes' or 'no,' with 'no' as the default. A locked widget cannot be moved or deleted from the Page Elements tab.

  4. title: (Optional) A display title for the widget. If none is specified, a default title such as 'List1' will be used.

  5. pageType: (Optional) Can be 'all,' 'archive,' 'main,' or 'item,' with 'all' as the default. The widget will display only on the designated pages of your blog. (All widgets display on the Page Elements tab, regardless of thier pageType.)

The widget types that can be specified are: BlogArchive, Blog, Feed, Header, HTML, SingleImage, LinkList, List, Logo, BlogProfile, Navbar, VideoBar, NewsBar.

The widget in simple form will just show you the placement of the widget. But if you need to edit the widget itself, then switch to the advanced form i.e., Expanded widgets.

The includables Tag.

A widget is a collection of includables and typically a main includable. Includables as their name suggests are piece of code that can be put together to avoid repetetion. This includable then can be included in one more places. Apart from removing repetition the includables also help in understanding the structure of the widget. Includable tag is also part of b namespace. So it will have the tag in this manner.

<b:includable id='[some-unique-id]' [attribs] >

The includable tag has the following attributes:

  1. id: (Required) A unique identifier made up of letters and numbers. Note: a widget must contain atleast a single includable and the id for that must be main.

  2. var: (Optional) An identifier made up of letters and numbers, for referencing data within this section. The data will be referenced similar to the namespace i.e., if var='a' is used then the title in data can be referred as a:title.

The include Tag.

The includable created above needs to be included in the widget for that we use the include tag. If your widget is having only a single includable then in that case the id of that includable should be main and for that a separate include is not required. That single includable will be included by default. The include tag contains two attribs mainly name refers to the id of the includable and data refers to var of includable. The includable tag is self closed and another closing tag is not required. The format is as shown.

<b:include name='[the-includable-name]' data='[the-expression-for-var]'/>

The attributes name and data:

  1. name: (Required) This name will be pointing to the includable which is to be included. There should be a includable with the id as this name.

  2. data: (Optional) Like a parameter is passed to function this data is passed to includable. It is a peice of data to pass on to the includable section. This will become the value of the var attribute in the includable.

We can have any name for includable but it must be unique for that widget. This includable can then be included in one or more places in the widget using the include tag.
Next lets discuss two more tags from the "b" namespace. They are if / else and the loop.

The if / else Tag.

The if/else tag is displayed as shown.

<!-- Only if-->
<b:if cond='[some condn check]'>
[Then do this]

<!-- both if and else-->
<b:if cond='[some cond check]'>
<!-- [Then do this] -->
<!-- [else do this] -->

From the code above the working of if and else would be quite clear. One thing to note is that the else tag is a self closing one. To understand the condition see the following examples.

<!-- to check a boolean variable. -->
<b:if cond='data:useImage'>
<!-- [execute if the header for your blog is image instead of text] -->

<!-- to compare equivalence of two values-->
<b:if cond='data:blog.pageType == "item"'>
<!-- [True if the current page is an item page (post page).] -->

<!-- to compare non-equivalence -->
<b:if cond='data:displayname != "Fred"'>
<!-- [True if this is not Fred's display name.] -->

<!-- comparing greater than, less than-->
<b:if cond='data:post.numComments > 1'>
<!-- [True if the current post has more than one comment.] -->

They say for any language if you know to control the flow you are done with the basics. So for completing the basics of blogger template we need to learn about if-else and a looping feature. One done One to Go. So lets discuss the loop feature now.

The Loop Tag.

This is also part of "b" namespace. It behaves as any loop should i.e., for every element in some set of elements you can do something. For e.g., In a set of comments display each comment. If you are looking for customizing your comments display you may have to look into this loop. The usage will be more clear once you have a look at the syntax.

<b:loop var='some-identifying-var' values='set-of-something'>
<!-- [For every var in the values i.e., for every data in the set of data do something here] -->

Now we are done with the basics, but one important thing remains - Displaying your data. Obviously you just dont want to have a beautiful page without any data. You need to display some data. For that we will have to learn about the data namespace.

Therefore data namespace contains the most important variables and if I mention it all in here it would be too cluttered. I will write a separate article on that. And as you must know you learn more experimenting then reading. So get your coffees ready and start experimenting with the code.

You are more than welcome to add more help in the comments. Also if you want or have a better explanation add it up in comments. If you have any doubts put them here. I would answer them if I know :).
Prevent Mobile Loss

Jan 10, 2009

Found my love my mobile

As I have mentioned earlier in the post "She broke up with me" my love, my mobile was lost in an auto rickshaw while commuting to office. Thanks to the prayers I & you made I am back again with her :). We did meet again. The breakup didn't last long. Hope it doesn't ever happen again.

The burning question that everybody is asking me now:

How to get lost / stolen mobile back?

When you search the net for lost mobile you will find thousands of links and pages, but very few posts from people who recovered it.

One of the reason I got mobile back is because I was very well prepared that this crisis might occur. Other reasons are chance and luck, which are beyond our control but the following things should be taken care of.

First: When you buy a mobile, keep your bills safe. Don't throw them away. Make sure your Bills are duly stamped and should contain your name, manufacturer name, model name and Product / Serial Number of your mobile. Keep all the manuals warranty etc that come along they are helpful although not for recovery.

Second: Take a note of your IMEI ( International Mobile Equipment Identity ) number. Its usually found printed on the phone under the battery along with the serial number. It is a unique number assigned to each mobile equipment. This number is unique to the device and has no relation to the SIM (Subscriber Identity Module) which stores the IMSI (International Mobile Subscriber Identity) and hence to sevice provider. It was introduced mainly to control mobile thefts. The logic used for tracking is as follows. Whenever a mobile connects to a GSM networks (IMEI is only for GSM networks) along with the SIM number and other information the mobile also transfers the IMEI number to identify itself as a valid device.
Now when a mobile is stolen or is to be tracked as who is using it, a alert can be placed on the IMEI number. The next time the number comes on the network it is identified as a invalid device and the alert is triggered on it with all the details i.e., the phone number / sim number etc, from where the person's address who is using the SIM etc can be found. A point to note here is that although most of the countries follow this standard and have laws implementing IMEI number for mobile devices, some countries although, like Singapore etc don't have such laws and there are devices without IMEI number. There are even techniques to remove/tamper the IMEI number of mobile equipments. But this techniques are against the law in many countries and require high skill and understanding. Its basically like a hack and proficient people can do it. More on IMEI number here.

Third: Although this wont help you find your mobile but will help you mitigate the loss, get an insurance on it. In many countries getting an insurance is a general practice while buying mobile. If your device is costly why not take it.

Fourth: Try and get a backup of all your data i.e., keep synchronising your device with your laptop or whatever. The activesync on windows mobile takes care of backing up your contacts, calendar appointments, E-mail, Tasks, Notes, Favourites, some files and other media. You can use some other Sync softwares which can keep your storage / memory card in sync. Make an habit of connecting your device to laptop (bluetooth sync is hasselfree).

Fifth: There are software which can be installed on the devices supporting multimedia i.e., having PC connectivity installed with OS as Windows Mobile, Symbian, Palm OS etc. There are only a few of these software which I am going to tell you about. These software are again a kind of hack and tampering done to track SIM card change. The logic of this software is simple. There is predefined configurable mobile number stored on your device (like in the mobile registry) which will be notified by a SMS, being sent in the background with the information like the new SIM number and mobile number inserted. Some more sophisticated softwares also insert the GPS coordinates of the mobile when sending the SMS, provided your device had GPS installed on it. So you can find out the person yourself who did this to you. You may find some free software look for them. This point may not be applicable to many of you and I admit its a bit geeky.

Sixth: Take Care Period.

Well I took care of most of the above points but I could not install these software on my device because of the performance tweak I did a few days before losing it. When I was talking about the performance tweak in the last post I was talking about this. The tweak basically was that I had formated my Windows mobile 6.0 and installed windows mobile 6.1 and along with that changed my IPL and SPL ( more of it on someother day if interested get started here). It freed a lot of locked memory on my device. So basically after doing it I did not install these software and the next day the mobile was lost.

Its basically like a stitch in time saves nine. So any precaution that you can take is good. With this all done you might not even lose your mobile. And if you lose it chances are that you will be back with your love as I am.

continued in...

So now how to Recover Lost mobile?