5/8/11

(Blogspot) - Blog của bạn sẽ pro hơn với Sharing is sexy

{Svip4u.InFo}
Sharing is sexy là công cụ khá hữu ích, để người xem blog của bạn có thể chia sẻ bài viết trên các hệ thống website thông dụng như: Google Bookmark, Twitter, v.v..

Vnblogspot sẽ hướng dẫn bạn cách chèn công cụ này vào blogspot của mình, để bạn đọc của bạn có thể chia sẻ bài viết theo 10 phương thức thông dụng nhất trên thế giới.
Dáng vẻ của Sharing is sexy
Sharing is sexy dạng 10 nút trông sẽ như thế này

1. Thêm CSS

Mở trình soạn thảo Template blog của bạn lên, sao lưu lại, rồi tìm đoạn code:

]]></b:skin

Xong bạn dán lên phía trên đoạn code đó với đoạn CSS sau:

div.shr-bookmarks{border-top:1px solid #DDD;width:600px;margin:30px 0 10px;padding-top:10px;clear:both}
div.shr-bookmarks-expand{height:32px;overflow:hidden}
div.shr-bookmarks ul.socials li{background-image:url(http://lh5.ggpht.com/_u7a1IFxc4WI/TOpovZBtJuI/AAAAAAAAAZI/fEMPwJQA-zw/shr.png);background-repeat:no-repeat}
div.shr-bookmarks ul.socials{float:left;width:100%;margin:0;padding:0}
div.shr-bookmarks ul.socials{background:transparent none;border:0 none;outline:0 none}
div.shr-bookmarks ul.socials li{background-color:transparent;float:left;border:0 none;width:60px;height:29px;margin:3px 0 0;padding:0;display:inline;list-style-type:none;cursor:pointer;outline:0 none;clear:none}
div.shr-bookmarks ul.socials li:before,div.shr-bookmarks ul.socials li:after,div.shr-bookmarks ul.socials li a:before,div.shr-bookmarks ul.socials li a:after{content:''}
div.shr-bookmarks ul.socials a,div.shr-bookmarks ul.socials a:hover{display:block;background-color:transparent;border:0 none;width:60px;height:29px;text-decoration:none;text-indent:-9999px}
div.shr-bookmarks ul.socials a:hover,div.shr-bookmarks ul.socials li:hover{background-color:transparent;border:0 none;outline:0 none}
li.shr-yahoomail{background-position:0px bottom}
li.shr-yahoomail:hover{background-position:0px top}
li.shr-googlebookmarks{background-position:-60px bottom}
li.shr-googlebookmarks:hover{background-position:-60px top}
li.shr-facebook{background-position:-120px bottom}
li.shr-facebook:hover{background-position:-120px top}
li.shr-twitter{background-position:-180px bottom}
li.shr-twitter:hover{background-position:-180px top}
li.shr-googlebuzz{background-position:-240px bottom}
li.shr-googlebuzz:hover{background-position:-240px top}
li.shr-technorati{background-position:-300px bottom}
li.shr-technorati:hover{background-position:-300px top}
li.shr-digg{background-position:-360px bottom}
li.shr-digg:hover{background-position:-360px top}
li.shr-delicious{background-position:-420px bottom}
li.shr-delicious:hover{background-position:-420px top}
li.shr-mail{background-position:-480px bottom}
li.shr-mail:hover{background-position:-480px top}
li.shr-comfeed{background-position:-540px bottom}
li.shr-comfeed:hover{background-position:-540px top}

2. Thêm code

Bạn hãy đánh dấu vào mục Mở rộng Mẫu Tiện ích (Expand Widget Templates), rồi tìm đoạn code sau, mình gọi là đoạn code "A":

<b:includable id='shareButtons' var='post'>

Từ chỗ đoạn code "A", bạn tìm đến đoạn code "B" như sau (ở dưới và gần đoạn code "A" nhất):

</b:includable>

Đoạn code "B" này thường nằm trên đoạn code:

<b:includable id='backlinks' var='post'>

Thay thế tất cả code ở giữa "A" và "B" bằng đoạn code sau:

<div class='shr-bookmarks shr-bookmarks-expand'>
<ul class='socials'>
<li class='shr-yahoomail'>
<a expr:href='&quot;ymsgr:im?+&amp;msg=&quot; + data:post.url' rel='nofollow' title='Gửi Bài đăng qua Yahoo! Messenger tới Bạn bè'/>
</li>
<li class='shr-facebook'>
<a expr:href='&quot;http://www.facebook.com/sharer.php?u=&quot; + data:post.url + &quot;&amp;title=&quot;+ data:post.title' rel='nofollow' target='_blank' title='Đăng lên Facebook'/>
</li>
<li class='shr-twitter'>
<a expr:href='&quot;http://twitthis.com/twit?url=&quot; + data:post.url + &quot;&amp;title=&quot;+ data:post.title' rel='nofollow' target='_blank' title='Đăng lên Twitter'/>
</li>
<li class='shr-googlebuzz'>
<a expr:href='&quot;http://www.google.com/buzz/post?url=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title' rel='nofollow' target='_blank' title='Đăng lên Google Buzz'/>
</li>
<li class='shr-technorati'>
<a expr:href='&quot;http://technorati.com/faves?add=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title' rel='nofollow' target='_blank' title='Đăng lên Technorati'/>
</li>
<li class='shr-digg'>
<a expr:href='&quot;http://digg.com/submit?url=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title' rel='nofollow' target='_blank' title='Đăng lên Digg'/>
</li>
<li class='shr-delicious'>
<a expr:href='&quot;http://del.icio.us/post?url=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title' rel='nofollow' target='_blank' title='Đăng lên Delicious'/>
</li>
<li class='shr-googlebookmarks'>
<a expr:href='&quot;http://www.google.com/bookmarks/mark?op=add&amp;bkmk=&quot; + data:post.url + &quot;&amp;title=&quot;+ data:post.title' rel='nofollow' target='_blank' title='Đăng lên Google Bookmarks'/>
</li>
<li class='shr-mail'>
<a expr:href='&quot;http://www.blogger.com/email-post.g?blogID=2747517855766540904&amp;postID=&quot; + data:post.id' rel='nofollow' target='_blank' title='Gửi Bài đăng qua email tới Bạn bè'/>
</li>
<li class='shr-comfeed'>
<a expr:href='data:blog.homepageUrl + &quot;feeds/posts/default&quot;' rel='nofollow' target='_blank' title='Đăng ký đọc tin RSS'/>
</li>
</ul>
<div class='clear'/>
</div>

Bạn lưu ý chỗ mình đã tô đỏ trong đoạn code trên, cần thay thế nó bằng blog ID của bạn.
Tiếp đến, bạn tìm đoạn code

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

Ở dưới và gần đoạn code này nhất là đoạn code "C" :

</b:includable>

Thường thì đoạn "C" này sẽ nằm ngay trên đoạn code:

<b:includable id='status-message'>

Bây giờ, việc còn lại của bạn là dán đoạn code sau đây lên ngay trên đoạn code "C":

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<b:include data='post' name='shareButtons'/>
</b:if>

Cuối cùng, bạn bấm nút  và ra xem blog để thưởng thức thành quả nào!

Update

Trường hợp sau khi chèn code, tự nhiên xuất hiện đến 2 thanh sexy bookmark trong bài viết thì các bạn bỏ đoạn code đã thêm vào như ở dưới đây:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<b:include data='post' name='shareButtons'/>
</b:if>

Vuilenblog  tham khảo CSS từ blog của Duy Phạm.

0 comments:

Post a Comment

Bạn hãy để lại comments nếu bài viết có ích nha.
Các comments sẽ được nhắc nhở nếu vi phạm các điều khoản mà mình tự hiểu.

Twitter Delicious Facebook Digg Stumbleupon Favorites More