Sharing 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..
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://dl.dropbox.com/u/52735711/shr.png);background-repeat:no-repeat}
div.shr-bookmarks ul.socials{float:left;width:100%;margin:0 0 0 50px;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:50px;height:26px;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:50px;height:29px;text-decoration:none;text-indent:-9999px; margin-top:3px;}
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:-50px bottom}
li.shr-googlebookmarks:hover{background-position:-50px top}
li.shr-facebook{background-position:-102px bottom}
li.shr-facebook:hover{background-position:-102px top}
li.shr-twitter{background-position:-154px bottom}
li.shr-twitter:hover{background-position:-154px top}
li.shr-googleplus{background-position:-206px bottom}
li.shr-googleplus:hover{background-position:-206px top}
li.shr-technorati{background-position:-258px bottom}
li.shr-technorati:hover{background-position:-258px top}
li.shr-digg{background-position:-310px bottom}
li.shr-digg:hover{background-position:-310px top}
li.shr-delicious{background-position:-362px bottom}
li.shr-delicious:hover{background-position:-362px top}
li.shr-mail{background-position:-414px bottom}
li.shr-mail:hover{background-position:-414px top}
li.shr-comfeed{background-position:-466px bottom}
li.shr-comfeed:hover{background-position:-466px 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='"ymsgr:im?+&msg=" + 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='"http://www.facebook.com/sharer.php?u=" + data:post.url + "&title="+ data:post.title' rel='nofollow' target='_blank' title='Đăng lên Facebook'/>
</li>
<li class='shr-twitter'>
<a expr:href='"http://twitthis.com/twit?url=" + data:post.url + "&title="+ data:post.title' rel='nofollow' target='_blank' title='Đăng lên Twitter'/>
</li>
<li class='shr-googleplus'>
<a expr:href='"https://plusone.google.com/_/+1/confirm?hl=vi&url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank' title='Đăng lên Google Plus'/>
</li>
<li class='shr-technorati'>
<a expr:href='"http://technorati.com/faves?add=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank' title='Đăng lên Technorati'/>
</li>
<li class='shr-digg'>
<a expr:href='"http://digg.com/submit?url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank' title='Đăng lên Digg'/>
</li>
<li class='shr-delicious'>
<a expr:href='"http://del.icio.us/post?url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank' title='Đăng lên Delicious'/>
</li>
<li class='shr-googlebookmarks'>
<a expr:href='"http://www.google.com/bookmarks/mark?op=add&bkmk=" + data:post.url + "&title="+ data:post.title' rel='nofollow' target='_blank' title='Đăng lên Google Bookmarks'/>
</li>
<li class='shr-mail'>
<a expr:href='"http://www.blogger.com/email-post.g?blogID=425207846457323766&postID=" + 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 + "feeds/posts/default"' 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 == "item"'> <b:include data='post' name='shareButtons'/> </b:if>
Bấm Lưu Lại
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 == "item"'> <b:include data='post' name='shareButtons'/> </b:if>
Không có nhận xét nào:
Đăng nhận xét