Kamis, 05 Februari 2009

Understanding Blogger Template - 3

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'>
<data:title/>
<b:else/>
<a expr:href='data:blog.homepageUrl'><data:title/></a>
</b:if>
</b:includable>


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'>
<img
expr:alt='data:title'
expr:height='data:height'
expr:id='data:widget.instanceId'
expr:src='data:sourceUrl'
expr:width='data:width'
style='display: block'
/>
</a>


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.


<a
rel="nofollow"
target="_blank"
expr:href='"http://www.stumbleupon.com/submit?url=" + data:post.url + "&amp;title=" + data:post.title'
title="StumbleUpon">
<img
src="../stumbleupon.png"
title="StumbleUpon"
alt="StumbleUpon"
class="sociable-hovers"
/>
</a>



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>
<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'>
<a
class='comment-link'
expr:href='data:post.addCommentUrl'
expr:onclick='data:post.addCommentOnclick'>
<b:if cond='data:post.numComments == 1'>
1 <data:top.commentLabel/>
<b:else/>
<data:post.numComments/> <data:top.commentLabelPlural/>
</b:if>
</a>
</b:if>
</b:if>
</span>
</div>


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.

Rabu, 04 Februari 2009

Cara Memasang Chat Box

ChatBox atau Shoutbox..satu ruang untuk berkomunikasi diantara tuan blog dengan pengunjungnya. Ada macam² jenis chatbox yang biasa digunakan oleh blogger, antaranya Cbox, ShoutMix, Oggix, Tag-World, GoogleTalk dan lain².

Ok harini Ana nak buat tutorial khas untuk Cbox. Sebab Ana sendiri pun guna cbox, dan juga untuk yang bertanya. Ok caranya..

1. Masuk ke laman ini. Klik Cbox ni.


2. Klik pada Get your own free Cbox now! atau sign up di atas untuk daftar akaun.

3. Isikan maklumat di ruangan ini.. dan klik Create my Cbox jika selesai. Gambar dibawah akan muncul jika Antum sudah berjaya daftar.

4. Seterusnya Daftar masuk kedalam akaun menggunakan username dan pasword yang Antum create tadi.. Kalau boleh pasword ni sentiasa diingati.


5. Untuk mendapatkan kodnya klik pada publish!. Jika mahu menukar warna cbox ini klik pada Look & Feel => Edit Style.

6. Copy kod yang diberikan dan paste kedalam blog. Pergi ke bahagian Layout => Page Elements => Add a Gadget => HTML/Javascript.

Ok siap...!

p/s: Kalau nak edit color Cbox ini setelah ditambah di blog, cukup sekadar menekan butang save dan refresh blog Antum tanpa memasukkan kod yang baru.


Selasa, 03 Februari 2009

Toshiba Rilis Smartphone Paling Revolusioner Setelah iPhone!

Vendor-vendor gadget mulai menunjukkan tajinya, menjelang Mobile World Congres 2009, pada 16-19 Februari 2009 di Barcelona, Spanyol. Salah satunya adalah Toshiba yang meluncurkan smartphone paling spektakulernya TG01.Melihat bentuknya yang bongsor, super langsing dan kemampuan fiturnya yang mumpuni TG01 bisa disebut sebagai PocketPC. Memiliki layar sentuh 4.1 inchi dengan resolusi WVGA (800 x 480

Minggu, 01 Februari 2009

Membuat Read More di Template Classic

Template Classic pun boleh buat readmore rupanya.. Manala Ana tau kan, xpernah guna pun tempalte classic ni. Terjun je dalam dunia blogging ni terus guna yang baru kan. Tutorial ni hanya untuk simpanan peribadi. Kalau ade kengkawan yang masih still classic bolehla dijadikan panduan. Ok ini cara...

1) Loggin => Template.

2) Masukkan code CSS atau style sheet Summary post (Yg berwarna merah) tu di antara <style type="text/css"> dan </style>

Contoh:

Name: Ms. Moto (Pinky Lee variation)
Designer: Jeffrey Zeldman
URL: www.zeldman.com
Date: 23 Feb 2004
----------------------------------------------- */


/* Primary layout */

<MainOrArchivePage>
span.fullpost {display:none;}
</MainOrArchivePage>

<ItemPage>
span.fullpost {display:inline;}
</ItemPage>

body {
margin: 0;
padding: 0;
border: 0;
text-align: center;
color: #555;
background: #d7b url(http://www.blogblog.com/moto_ms/outerwrap.gif) top center repeat-y;
font: small tahoma, "Bitstream Vera Sans", "Trebuchet MS", "Lucida Grande", lucida, helvetica, sans-serif;
}


3) Kemudian untuk meletakkan pautan Read More.. Cari code Blog Item Body dan letakkan code pautan tersebut di bawahnya.

<$BlogItemBody$>

<MainOrArchivePage><br />
<a href="<$BlogItemPermalinkURL$>">Read more!</a>
</MainOrArchivePage>


4) Lepas tu Save Template.

5) Kemudian seperti biasalah letakkan code Span Full Post di setiap entri Antum atau bila nak Create post yg baru iaitu:

<span class="fullpost"></span>


Contoh:

Ini adalah ringkasan ceritaku blabla pokpek!
<span class="fullpost">
Dan ini adalah selebihnya dari ringkasan tersebut
</span>


6) Kalau nak buat read more setiap kali posting, Antum boleh letakkan kode ini di bahagian Settings=> Formatting=>Post Template.

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


Sumber : Muncet.com

Sabtu, 31 Januari 2009

Memasang Emoticon Di Post Entry

angelnerdpokpokcallmeadacalltensionbabaiaroundtandukbusukdiammerajukgilesetansigh
gelakgulingjelirtepuktangansoalnangihputuscinteciumxpastisedihsenyumkenyitkenyitmaludoaduitsembahcelebratetakbole

Emoticon Yahoo! Messenger..Sebenarnya dah ramai yang buat tutorial ni.. Ana tulis balik untuk simpanan peribadi..Kalau nak emoticon lain Antum boleh ke Chokilala.com. Disana ada macam² emoticon yang comel dan menarik. Chokilala memang pandai buat emoticon. Ok untuk yang ini, caranya begini..

Tutorial ini memerlukan kepada langkah berikut:-

1. Menggunakan Web Browser Firefox, mesti guna Firefox, yang lain tak boleh.. nak pulak IE yang kurang best tu. Maka bertukarla ke Firefox. Download Sini. Pastikan sudah menggunakan Firefox untuk step seterusnya.

2. Memasang Add-ons Greasemonkey. Kalau belum Install Disini. Senang aje. Ikut arahannya. Bila selesai, akan muncul icon kepala monyet yang berjambul dibawah.

3. Seterusnya install script emoticon Yahoo! Messenger dengan mengetik Script Ini. Bila keluar satu kotak, klik pada Install.

Ok selesai.. Emoticon sudah wujud di post editor Antum. Selamat beremosi dalam menulis.sengihnampakgigi

Tambahan: Kalau gambar di posting Antum telah diborderkan, maka setiap emoticon yang ditampilkan akan berserta dengan border. Untuk hilangkan border tersebut, tambahkan kode ini sebelum ]]></b:skin>

img.emoticon {
border: 0;
}


Jumat, 30 Januari 2009

File Compare Utility

I ever have any problems with my computer, especially with the problem file, folder, and when I find a Compare Suite.Compare Suite is a file and folder comparison tool, which supports a lot of comparison for the file formats such as RTF (Rich Text Format) , Rar (archive format, just like ZIP), PAS (Pascal format of the files). It can compare not only files, but highlight files' syntax.if you

Rabu, 28 Januari 2009

Daftar ngeBUX disini,PTC indonesia baru!!

Dafter ngeBUX disini PTC indonesia yang baru,masih fresh bro...Tiap klik dapet Rp.150,lebih besar dari yang sebelumnya,ayo daftar disini!!!ngeBUX akan membayar anda mulai dari Rp. 150 / click hingga Rp. 200 / click.Untuk mendapatkan uang di website ini,anda cukup meng-klik iklan yang tersedia dihalaman "Klik Iklan" website kami dan tunggu hingga 30 detik,setiap anda mengklik iklan,kami akan