Hiển thị các bài đăng có nhãn blogger. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn blogger. Hiển thị tất cả bài đăng

22 thg 12, 2011

Thêm bài viết ngẫu nhiên cho blogspot

Để tạo được bài viết ngẫu nhiên cho blogspot. Hôm nay xin chia sẻ với các bạn cách tạo bài viết ngẫu nhiên.



Trước tiên các bạn truy cập vào địa chỉ đây Chọn blog cần tạo bài viết ngẫu nhiên





Click vào “ĐỊNH CẤU HÌNH TIỆN ÍCH” và cá bạn điền thông tin tương tự như sau





Các bạn có thể xem trước thiết lập của mình ngay phía bên dưới. Khi thiết lập nếu “Show Powered by Link” chọn Yes thì sẽ có dòng “Powered By : Blogger Plugins” ở phía cuối widgat bài viết ngẫu nhiên (Nên chọn No”)





Sau khi thiết lập xong các bạn chọn “LƯU” và vào “Thiết kế” để di chuyển widget đến vị trí thích hợn nhá.



Chúc các bạn thành công

5 thg 5, 2011

Tạo trang Sitemap cho Blogger





Sơ đồ Blog - Sitemap hay còn gọi là Table of Contents là một bảng phụ lục liệt kê tất cả các bài viết trên Blog theo từng trương mục ( Labels ) hoặc theo thời gian ( Archived ) một cách tự động.



Cùng với các tiện ích như Numbered Page Navigation, Related Posts hay Breadcrumb, góp phần tạo nên sự điều hướng dễ dàng và thuận tiện cho độc giả, giúp gia tăng Pageview và giữ chân độc giả ở lại Blog bạn lâu hơn.






Ý tưởng bắt nguồn từ Amanda - một Blogger tên tuổi, sau đó được Abu-Farhan cải tiến giúp tiện ích trở nên đơn giản và bắt mắt hơn.



Chính vì những lợi ích rất thiết thực mà tiện ích mang lại, hôm nay iTechPlus xin giới thiệu đến các bạn 3 style của tiện ích này nhằm giúp các bạn có nhiều sự lựa chọn phù hợp cho Blog của mình.



Style 1 : Table of Contents by Label




Table of Contents by Label





1. Vào Chỉnh sửa Bài đăng > Chỉnh sửa Trang > Trang mới để đặt tiện ích trên một Static Page

2. Chuyển qua chế độ Chỉnh sửa HTML và dán vào đoạn code bên dưới


<script style="text/javascript" src="http://www.abu-farhan.com/script/daftarisiblogger/blogtoc-min.js"></script>

<script src="http://www.itdl.in/feeds/posts/default?max-results=9999&amp;alt=json-in-script&amp;callback=loadtoc"></script>

3. Thay đoạn code in đậm bằng địa chỉ blog bạn rồi nhấn Xuất bản trang là OK.



* Vì là một trang Page nên bạn có thể đặt đâu tùy ý, hoặc get link và tạo một liên kết trên thanh menu.



Style 2 : Table of Contents by Date ( Archived )




Table of Contents by Archived


Thực hiện các bước tương tự Style 1, chỉ thay nội dung bằng đoạn code sau :


<script style="text/javascript" src="http://abu-farhan.com/script/daftarisibloggerarchive/tocbyarchivemin.js"></script>

<script src="http://www.itdl.in/feeds/posts/default?max-results=500&alt=json-in-script&callback=loadtoc"></script>

Style 3 : Table of contents and Accordion




Table of contents and Accordion





Thực hiện các bước tương tự Style 1, chỉ thay nội dung bằng đoạn code sau :


<link href="http://abu-farhan.com/script/acctoc/acc-toc.css" media="screen" rel="stylesheet" type="text/css"></link>

<script src="http://abu-farhan.com/script/acctoc/daftarisiv2-pack.js"></script>

<script src="http://www.itdl.in/feeds/posts/summary?max-results=1000&amp;alt=json-in-script&amp;callback=loadtoc"></script>

<script type="text/javascript">

var accToc=true;

</script>

<script src="http://abu-farhan.com/script/acctoc/accordion-pack.js" type="text/javascript"></script>

Style 4 : Table of contents and Accordion








Thực hiện các bước tương tự Style 1, chỉ thay nội dung bằng đoạn code sau :


<link href="http://abu-farhan.com/script/acctoc/acc-toc.css" media="screen" rel="stylesheet" type="text/css"></link>

<script src="http://abu-farhan.com/script/acctoc/daftarisiv2-pack.js"></script>

<script src="http://www.itdl.in/feeds/posts/summary?max-results=1000&amp;alt=json-in-script&amp;callback=loadtoc"></script>

<script type="text/javascript">

var accToc=true;

</script>

<script src="http://abu-farhan.com/script/acctoc/accordion-pack.js" type="text/javascript"></script>

* Lưu ý : các bạn nên download các file .js và .css về lưu trữ hoặc upload lên host riêng đề phòng trường hợp host trên die.



Như vậy là bạn đã tạo cho mình một Sơ đồ Blog update bài viết hoàn toàn tự động rồi đó.

Chúc các bạn thành công !




iTechPlus ( Theo Abu-Farhan )

Tiện ích Multi Tabbed Widget For Blogger

Simple Multi Tabbed Widget for BloggerMulti Tabbed Widget là tiện ích được sử dụng khi trên Blog bạn có chứa khá nhiều widget. Một giải pháp thường được các Blogger áp dụng là chia footer-wrapper làm nhiều cột để chứa các widget này.



Tuy nhiên, điều này không phải ai cũng thích, nhất là các blog được thiết kế mang phong cách báo chí (như iTechPlus.info chẳng hạn). Từ đó mới xuất hiện tiện ích gọi là Multi Tabbed Widget.



Tiện ích này xuất hiện từ khá lâu, mà bắt nguồn từ các Blog sử dụng nền tảng Wordpress, sau đó được các Pro Blogger “bào chế” để áp dụng cho Blogspot.



Sử dụng Multi Tabbed Widget không những giúp tiết kiệm không gian trên Blog, làm cho Blog của bạn trông gọn gàng hơn, mà còn có thể giúp tăng thời gian tải trang cho Blog của bạn do nó kết hợp hai hay nhiều widget làm một.



Và trong bài viết dưới đây, iTechPlus sẽ giới thiệu đến các bạn 2 Style của tiện ích này.



1. Style 1 : Simple Multi Tabbed Widget for Blogger






Simple Multi Tabbed Widget for Blogger 



Đây là tiện ích đơn giản nhất, có thể chèn vào nó các widget HTML\JavaScript.



Thực hiện :





A. Vào Thiết kế > Chỉnh sửa HTML

B. Chèn đoạn code bên dưới vào trước thẻ đóng </head>


<script type='text/javascript'>

//<![CDATA[

function tabtampil_oom(TPID, id)

{

  var Tabtampil = document.getElementById(TPID);

  var TTs = Tabtampil.firstChild;

  while (TTs.className != "TTs" ) TTs = TTs.nextSibling;

  var TT = TTs.firstChild;

  var i   = 0;

  do

  {

    if (TT.tagName == "A")

    {

      i++;

      TT.href      = "javascript:tabtampil_ubah('"+TPID+"', "+i+");";

      TT.className = (i == id) ? "Active" : "";

      TT.blur();

    }

  }

  while (TT = TT.nextSibling);

  var Halamans = Tabtampil.firstChild;

  while (Halamans.className != 'Halamans') Halamans = Halamans.nextSibling;

  var Halaman = Halamans.firstChild;

  var i    = 0;

  do

  {

    if (Halaman.className == 'Halaman')

    {

      i++;

      if (Halamans.offsetHeight) Halaman.style.height = (Halamans.offsetHeight-2)+"px";

      Halaman.style.overflow = "auto";

      Halaman.style.display  = (i == id) ? 'block' : 'none';

    }

  }

  while (Halaman = Halaman.nextSibling);

}

function tabtampil_ubah(TPID, id) { tabtampil_oom(TPID, id);

}

function tabtampil_inisial(TPID) { tabtampil_oom(TPID,  1);

document.write('');}

//]]>

</script>

C. Tạo một widget HTML\JavaScript và chèn vào đoạn code sau :


<style type="text/css">

div.TabTampil div.TTs

{height: 24px; overflow: hidden; }

div.TabTampil div.TTs a:hover, div.TabTampil div.TTs a.Active

{ background-color: #eee; }

div.TabTampil div.Halamans

{ clear: both; border: 1px solid #fff; overflow: hidden; background-color:#ffffff;}

div.TabTampil div.Halamans div.Halaman

{ height: 100%; padding: 0px; overflow: hidden; }

div.TabTampil div.Halamans div.Halaman div.Alas

{ padding: 3px 5px; }

div.TabTampil div.TTs a

{ border-left:1px solid #eee; border-right:1px solid #eee; border-top:1px solid #eee; border-bottom:0px solid #eee; float: left;

display: block; width: 95px; text-align: center; vertical-align: middle; height: 24px; padding-top: 3px; text-decoration: none; font-family: "Arial", Serif;

font-size: 11px; font-weight: 900; color: #000000}

</style>

<form action="tabtampil.html" method="get">

<div id="TabTampil" class="TabTampil">

<div style="width: 300px;" class="TTs"> <a>Tiêu đề Widget 1</a> <a>Tiêu đề Widget 2</a> <a>Tiêu đề Widget 3</a></div>

<div style="width: 300px; height: 300px;" class="Halamans">

<div class="Halaman">

<div class="Alas">

<br/>

Nội dung Widget 1

</div>

</div>

<div class="Halaman">

<div class="Alas">

<br/>

Nội dung Widget 2

</div>

</div>

<div class="Halaman">

<div class="Alas">

<br/>

Nội dung Widget 3

</div>

</div>

</div>

</div>

</div></form>

<script type="text/javascript">tabtampil_inisial('TabTampil');</script>

Trong đoạn code trên :


  • #eee : là màu nền của Tabs, mặc định là màu xám

  • #fff : là màu đường viền của tiện ích

  • #ffffff : là màu nền của thân widget

  • #eee : là màu đường viền bao quanh Tabs

  • #000000 : là màu tiêu đề Tabs


Để thay đổi thành màu khác, các bạn có thể sử dụng phần mềm Colorcop để lấy mã Hex của các màu.





2. Style 2 : Advanced Multi Tabbed Widget For Blogger – Fully Widgetized!




 Advanced Multi Tabbed Widget For Blogger – Fully Widgetized!



Đây là tiện ích cao cấp hơn. Với nó, bạn có thể chèn vào nó bất kỳ widget nào nếu muốn ( archives, labels, author,… )



Thực hiện :





A. Vào Thiết kế > Chỉnh sửa HTML

B. Chèn đoạn code sau vào trong trường Variable definitions, khi đó trông sẽ giống như sau :


/* Variable definitions

   ====================

………………………………………………………

<Variable name="tbbxbgcolor" description="Tab box Background Color" type="color" default="#f8f8f8" value="#f8f8f8">

<Variable name="tbbxbrcolor" description="Tab box Border Color" type="color" default="#dcdcdc" value="#dcdcdc">

<Variable name="tbbxcolor1" description="Tab box Color 1" type="color" default="#ffffff" value="#ffffff">

<Variable name="tbbxcolor2" description="Tab box Color 2" type="color" default="#5588aa" value="#5588aa">

*/

Đoạn code trên nhằm xác định màu sắc cho các thành phần của widget như sau :


  • #f8f8f8 : màu nền của tiện ích

  • #dcdcdc : màu đường viền của tiện ích và Tabs

  • #ffffff : màu nền của thân tiện ích và cũng là màu khi rê chuột vào tiêu đề Tabs

  • #5588aa : màu nền của tiêu đề Tabs


C. Chèn đoạn code sau vào trước thẻ đóng </b:skin>


.tabberlive{

margin:0;

padding:5px;

clear:both;

background:$tbbxbgcolor;

border:1px solid $tbbxbrcolor;

}

.tabbernav {

margin:0;

padding: 3px 0;

border-bottom: 1px solid $tbbxbrcolor;

font-family:Arial,Helvetica,sans-serif;

font-size:12px;

font-weight:bold;

}

.tabbernav li {

list-style:none;

margin:0;

display:inline;

}

.tabbernav li a {

padding:3px 0.5em;

margin-right:1px;

border:1px solid $tbbxbrcolor;

border-bottom:none;

background:$tbbxcolor2;

text-decoration:none;

color:$tbbxcolor1;

}

.tabbernav li a:hover {

color:$tbbxcolor2;

background:$tbbxcolor1;

border-color:$tbbxbrcolor;

text-decoration:none;

}

.tabbernav li.tabberactive a,

.tabbernav li.tabberactive a:hover {

background:$tbbxcolor1;

color:$tbbxcolor2;

border-bottom: 1px solid $tbbxcolor1;

}

.tabberlive .tabbertab {

padding:5px;

border:1px solid $tbbxbrcolor;

border-top:0;

background:$tbbxcolor1;

}

.tabberlive .tabbertab h2,

.tabberlive .tabbertabhide {

display:none;

}

.tabbertab .widget-content ul{

list-style:none;

margin:0 0 10px 0;

padding:0;

}

.tabbertab .widget-content li {

border-bottom:1px solid $tbbxbrcolor;

margin:0 5px;

padding:2px 0 5px 0;

}

D. Tiếp tục, chèn đoạn code bên dưới vào trước thẻ đóng </head>


<script type='text/javascript'>

//<![CDATA[

document.write('<style type="text/css">.tabber{display:none;}<\/style>');

function tabberObj(argsObj)

{

  var arg;

  this.div = null;

  this.classMain = "tabber";

  this.classMainLive = "tabberlive";

  this.classTab = "tabbertab";

  this.classTabDefault = "tabbertabdefault";

  this.classNav = "tabbernav";

  this.classTabHide = "tabbertabhide";

  this.classNavActive = "tabberactive";

  this.titleElements = ['h2','h3','h4','h5','h6'];

  this.titleElementsStripHTML = true;

  this.removeTitle = true;

  this.addLinkId = false;

  this.linkIdFormat = '<tabberid>nav<tabnumberone>';

  for (arg in argsObj) { this[arg] = argsObj[arg]; }

  this.REclassMain = new RegExp('\\b' + this.classMain + '\\b', 'gi');

  this.REclassMainLive = new RegExp('\\b' + this.classMainLive + '\\b', 'gi');

  this.REclassTab = new RegExp('\\b' + this.classTab + '\\b', 'gi');

  this.REclassTabDefault = new RegExp('\\b' + this.classTabDefault + '\\b', 'gi');

  this.REclassTabHide = new RegExp('\\b' + this.classTabHide + '\\b', 'gi');

  this.tabs = new Array();

  if (this.div) {

    this.init(this.div);

    this.div = null;

  }

}

tabberObj.prototype.init = function(e)

{

  var

  childNodes,

  i, i2,

  t,

  defaultTab=0,

  DOM_ul,

  DOM_li,

  DOM_a,

  aId,

  headingElement;

  if (!document.getElementsByTagName) { return false; }

  if (e.id) {

    this.id = e.id;

  }

  this.tabs.length = 0;

  childNodes = e.childNodes;

  for(i=0; i < childNodes.length; i++) {

    if(childNodes[i].className &&

       childNodes[i].className.match(this.REclassTab)) {

      t = new Object();

      t.div = childNodes[i];

      this.tabs[this.tabs.length] = t;

      if (childNodes[i].className.match(this.REclassTabDefault)) {

    defaultTab = this.tabs.length-1;

      }

    }

  }

  DOM_ul = document.createElement("ul");

  DOM_ul.className = this.classNav;

  for (i=0; i < this.tabs.length; i++) {

    t = this.tabs[i];

    t.headingText = t.div.title;

    if (this.removeTitle) { t.div.title = ''; }

    if (!t.headingText) {

      for (i2=0; i2<this.titleElements.length; i2++) {

    headingElement = t.div.getElementsByTagName(this.titleElements[i2])[0];

    if (headingElement) {

      t.headingText = headingElement.innerHTML;

      if (this.titleElementsStripHTML) {

        t.headingText.replace(/<br>/gi," ");

        t.headingText = t.headingText.replace(/<[^>]+>/g,"");

      }

      break;

    }

      }

    }

    if (!t.headingText) {

      t.headingText = i + 1;

    }

    DOM_li = document.createElement("li");

    t.li = DOM_li;

    DOM_a = document.createElement("a");

    DOM_a.appendChild(document.createTextNode(t.headingText));

    DOM_a.href = "javascript:void(null);";

    DOM_a.title = t.headingText;

    DOM_a.onclick = this.navClick;

    DOM_a.tabber = this;

    DOM_a.tabberIndex = i;

    if (this.addLinkId && this.linkIdFormat) {

      aId = this.linkIdFormat;

      aId = aId.replace(/<tabberid>/gi, this.id);

      aId = aId.replace(/<tabnumberzero>/gi, i);

      aId = aId.replace(/<tabnumberone>/gi, i+1);

      aId = aId.replace(/<tabtitle>/gi, t.headingText.replace(/[^a-zA-Z0-9\-]/gi, ''));

      DOM_a.id = aId;

    }

    DOM_li.appendChild(DOM_a);

    DOM_ul.appendChild(DOM_li);

  }

  e.insertBefore(DOM_ul, e.firstChild);

  e.className = e.className.replace(this.REclassMain, this.classMainLive);

  this.tabShow(defaultTab);

  if (typeof this.onLoad == 'function') {

    this.onLoad({tabber:this});

  }

  return this;

};

tabberObj.prototype.navClick = function(event)

{

  var

  rVal,

  a,

  self,

  tabberIndex,

  onClickArgs;

  a = this;

  if (!a.tabber) { return false; }

  self = a.tabber;

  tabberIndex = a.tabberIndex;

  a.blur();

  if (typeof self.onClick == 'function') {

    onClickArgs = {'tabber':self, 'index':tabberIndex, 'event':event};

    /* IE uses a different way to access the event object */

    if (!event) { onClickArgs.event = window.event; }

    rVal = self.onClick(onClickArgs);

    if (rVal === false) { return false; }

  }

  self.tabShow(tabberIndex);

  return false;

};

tabberObj.prototype.tabHideAll = function()

{

  var i;

  for (i = 0; i < this.tabs.length; i++) {

    this.tabHide(i);

  }

};

tabberObj.prototype.tabHide = function(tabberIndex)

{

  var div;

  if (!this.tabs[tabberIndex]) { return false; }

  div = this.tabs[tabberIndex].div;

  if (!div.className.match(this.REclassTabHide)) {

    div.className += ' ' + this.classTabHide;

  }

  this.navClearActive(tabberIndex);

  return this;

};

tabberObj.prototype.tabShow = function(tabberIndex)

{

  var div;

  if (!this.tabs[tabberIndex]) { return false; }

  this.tabHideAll();

  div = this.tabs[tabberIndex].div;

  div.className = div.className.replace(this.REclassTabHide, '');

  this.navSetActive(tabberIndex);

  if (typeof this.onTabDisplay == 'function') {

    this.onTabDisplay({'tabber':this, 'index':tabberIndex});

  }

  return this;

};

tabberObj.prototype.navSetActive = function(tabberIndex)

{

  this.tabs[tabberIndex].li.className = this.classNavActive;

  return this;

};

tabberObj.prototype.navClearActive = function(tabberIndex)

{

  this.tabs[tabberIndex].li.className = '';

  return this;

};

function tabberAutomatic(tabberArgs)

{

  var

    tempObj,

    divs,

    i;

  if (!tabberArgs) { tabberArgs = {}; }

  tempObj = new tabberObj(tabberArgs);

  divs = document.getElementsByTagName("div");

  for (i=0; i < divs.length; i++) {

    if (divs[i].className &&

    divs[i].className.match(tempObj.REclassMain)) {

      tabberArgs.div = divs[i];

      divs[i].tabber = new tabberObj(tabberArgs);

    }

  }

  return this;

}

function tabberAutomaticOnLoad(tabberArgs)

{

  var oldOnLoad;

  if (!tabberArgs) { tabberArgs = {}; }

  oldOnLoad = window.onload;

  if (typeof window.onload != 'function') {

    window.onload = function() {

      tabberAutomatic(tabberArgs);

    };

  } else {

    window.onload = function() {

      oldOnLoad();

      tabberAutomatic(tabberArgs);

    };

  }

}

/* Run tabberAutomaticOnload() unless the "manualStartup" option was specified */

if (typeof tabberOptions == 'undefined') {

    tabberAutomaticOnLoad();

} else {

  if (!tabberOptions['manualStartup']) {

    tabberAutomaticOnLoad(tabberOptions);

  }

}

//]]>

</script>

E. Cuối cùng, tìm trong template dòng <div id='sidebar-wrapper'> và chèn đoạn code sau vào trên\dưới hoặc trước thẻ đóng </div> của nó :


<div style='clear:both;'/>

<div class='tabber'>

<b:section class='tabbertab' id='tab1' maxwidgets='1'/>

<b:section class='tabbertab' id='tab2' maxwidgets='1'/>

<b:section class='tabbertab' id='tab3' maxwidgets='1'/>

<b:section class='tabbertab' id='tab4' maxwidgets='1'/>

</div>


Khi đó sẽ trông giống như hình dưới ( trường hợp chèn bên trong <div id='sidebar-wrapper'> )




Tìm trong template dòng <div id='sidebar-wrapper'> và chèn đoạn code sau vào trên\dưới hoặc trước thẻ đóng </div> của nó



F. Lúc này, bạn chỉ việc quay trở lại Phần tử trang và thêm bất kỳ widget nào vào trong nó

 Quay trở lại Phần tử trang và thêm bất kỳ widget nào vào trong nó



Chúc các bạn thành công !


Nguồn: iTechPlus

25 thg 4, 2011

Thêm target blank và nofollow cho links trong blog





Cách 1





Đoạn code chèn vào blog này khá ngắn gọn và đơn giản do dùng jQuery để làm. Mở template của bạn lên, chèn đoạn code sau ngay trước thẻ </body>





<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">

$(function() {
var domain = 'http://www.itdl.in';

// Them target="_blank" cho tat ca cac link
$('a').attr('target', '_blank');

// Them rel="nofollow" cho cac link den trang web khac (khong cung domain)
$('a:not([href^=' + domain + '])').attr('rel', 'nofollow');
});
</script>





Các bạn chỉ cần sửa dòng khai báo domain trong đoạn code trên là được.



Cách 2



Đặt đoạn code trên vào ngay trên thẻ đóng </body> của trang bạn





<script type="text/javascript">
//<![CDATA[
function changetargetlink(x){
var a = document.getElementsByTagName('a');
var args = changetargetlink.arguments;
for(var i in a){
a[i].target = "_blank";
a[i].rel = "nofollow";
for(var j=0;j<args.length;j++){
if(a[i].href.match(args[j])){
a[i].target = "";
a[i].rel = "";
}}}}
changetargetlink('itdl.in','abc.com');
//]]>
</script>



Chú ý dòng đã được đánh dấu: itdl.in và abc.com có nghĩa là những trang sẽ không mở ở dạng _blank (new tab). Bạn có thể thêm hoặc bớt tùy ý vài địa chỉ nữa như sau:



changetargetlink('itdl.in','abc.com','cde.com','....'); 



Thông thường thì ta sẽ đặt các link cho trang của ta sẽ không mở new tab, còn lại tất cả các trang khác sẽ mở ở new tab, như thế ta sẽ chỉ đặt 1 giá trị cho nó nhẹ:



changetargetlink('itdl.in'); 



Hy vọng là script nhỏ này sẽ giúp bạn bớt chút công sức về đặt target cho link của bài viết.



Chú ý là cả 2 đoạn code trên đều dùng javascript để chèn nofollow nên có thể sẽ không hiệu quả (trong việc kiểm soát PageRank) nếu các con bọ của các trình duyệt không đọc được javascript.




(Sưu tầm)

10 thg 4, 2011

Thêm title cho link bài viết, tạo breadcrumbs trong Blogspot

Mặc dù Blogspot là một platform được đánh giá rất cao và nhiều người sử dụng trong năm 2010 nhưng không thể phủ nhận rằng Wordpress đang chiếm ưu thế và nhiều blogger Việt đang bỏ Blogspot để theo đi theo tiếng gọi của em WP. Mình chắc chắn sẽ vẫn gắn bó với blogspot nhưng cũng sẽ từ từ tìm hiểu WP để biết thêm về sức mạnh của nó. Hôm nay xin chia sẻ với các bạn hai thủ thuật tuy không mới nhưng mình thấy vẫn còn ít người dùng blogspot sử dụng.



1. Thêm phần mô tả cho link bài viết



Nghe tiêu đề trên có vẻ hơi khó hiểu nhưng bạn sẽ thấy ngay vấn đề khi xem hình dưới đây:




Title link for blogspot posts title





Như bạn thấy, khi đưa trỏ chuột tới tiêu đề bài viết thì ta thấy ngay phần mô tả của link, trong trường hợp trên Blogger+ thì nó cũng chính là nội dung của tiêu đề. Điều này cũng giống như khi bạn tạo một liên kết mới và thêm thẻ title để miêu tả cho liên kết khi đưa trỏ chuột tới.



Chúng ta sẽ thêm một đoạn code nhỏ để nó tự động làm việc này đối với mỗi tiêu đề bài viết.



Bạn vào phần chỉnh sửa HTML, chọn Expand Widget Templates. Tìm tới đoạn code:


<a expr:href='data:post.link'><data:post.title/></a>

Và thay thế nó bằng:


<a expr:href='data:post.link' expr:title='data:post.title'><data:post.title/></a>

Tiếp tục tìm tới đoạn code:


<a expr:href='data:post.url'><data:post.title/></a>

Và thay thế nó bằng:


<a expr:href='data:post.url' expr:title='data:post.title'><data:post.title/></a>

Bạn lưu template và kiểm tra kết quả.



Tại sao chúng ta lại thực hiện thủ thuật này?



Thực ra trước tiên về mặt cảm quan thì mình thấy nó cũng khá đẹp, còn theo một số người thì nó cũng có tác dụng hỗ trợ SEO. Rất nhiều blog sử dụng tính năng này.



2. Tạo breadcrumbs



Cũng giống như "Bài viết liên quan", Breadcrumbs giúp người đọc có thể "di chuyển" dễ dàng hơn trong blog của bạn, một yếu tố có thể góp phần làm tăng pageview.








Breadcrumbs





Thông thường người ta thường tạo Breadcrumbs theo cấu trúc:


Trang chủ >>Chủ đề >>Tiêu đề bài viết

Nhưng theo quan điểm cá nhân thì mình nghĩ chỉ cần tạo như hình minh họa trên là đủ.



Trong WP thì bạn có thể bật tính năng này lên nhưng với Blogspot thì cần phải thêm một đoạn code nhỏ.



Bạn vào phần chỉnh sửa HTML, chọn Expand Widget Templates. Tìm tới đoạn code:


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



<div class='post hentry'>

Hoặc chỉ có một dòng:


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



Lưu ý: Tùy vào template mà đoạn code cần tìm có thể hơi khác một chút nhưng nó phải có dạng tương tự như trên.



Sau khi đã tìm thấy bạn thêm đoạn code dưới đây vào ngay sau nó:


<b:if cond='data:blog.pageType == "item"'>



<div id='breadcrumbs'>



You are here:



<a expr:href='data:blog.homepageUrl'>Home</a> &raquo;



<b:if cond='data:post.labels'>



<b:loop values='data:post.labels' var='label'>



<a expr:href='data:label.url + "?max-results=6"'><data:label.name/></a>



<b:if cond='data:label.isLast != "true"'> &raquo;



</b:if>



</b:loop>



</b:if>



</div>



</b:if>

Phần max-results là phần qui định số bài viết hiển thị trong một trang khi chọn một nhãn nào đó.



(Cảm ơn Tuấn Anh bên Hỗn tạp blog đã cung cấp cho mình đoạn code này).



Cuối cùng chúng ta cần điều chỉnh CSS một chút để Breadcrumb phù hợp với template.



Tìm tới ]]></b:skin> và thêm đoạn code dưới đây vào ngay trước nó:


#breadcrumbs{border:1px solid #ccc;background:#efefef;font-size:11px;font-weight:bold;margin-bottom:20px;padding:7px 10px}

#breadrcumbs a{color:#999;font-weight:normal}

#breadcrumbs a:hover{color:#666}



Các bạn có thể bỏ phần border nếu muốn, thay đổi màu nền, loại font, cỡ font, màu link... cho phù hợp với template của mình nhé.



Lưu template và kiểm tra kết quả.



Trên đây là hai thủ thuật nhỏ cho Blogger. Hy vọng nó sẽ có ích cho các bạn.



Chúc bạn thành công !

31 thg 3, 2011

Tạo phân trang (page navigation) cho Blogspot

Numbered Page Navigation hack for Blogger (New & Error free)


Specially thanks to Abu Farhan for this new script. As I already stated Page navigation allows us to number blog pages(1, 2, 3 ....) like those of a book. This replaces the 'newer' and 'older' post links and give users/visitors an ability to go to the deep into your blog.


So let's add this elegant hack to your blog.



STEP 1 - Adding CSS Style



Go to Blogger Dashboard > Layout > Edit HTML. Always Download Full Template for Backup. Do NOT click on Expand Widget Templates. Now look for



]]></b:skin>


Now add following code ABOVE it.



.showpageNum a {

padding: 3px 8px;

margin:0 4px;

text-decoration: none;

border:1px solid #999;

-webkit-border-radius:3px;-moz-border-radius:3px;

background: #ddd;

}

.showpageOf {

margin:0 8px 0 0;

}

.showpageNum a:hover {

border:1px solid #888;

background: #ccc;

}

.showpagePoint {

color:#fff;

text-shadow:0 1px 2px #333;

padding: 3px 8px;

margin: 2px;

font-weight: 700;

-webkit-border-radius:3px;-moz-border-radius:3px;

border:1px solid #999;

background: #666;

text-decoration: none;

}
This is a one style code. But you can choose your suitable one. All styles are created byAbu Farhan.



CSS Style



Style 1

Style 2

Style 3

Style 4

Style 5

Style 6


Demo of Above Styles







STEP 2 - Adding JavaSript



Look for

</body>
And add following code ABOVE it.



<script type='text/javascript'>

var home_page='/';

var urlactivepage=location.href;

var postperpage=7;

var numshowpage=4;

var upPageWord ='Prev';

var downPageWord ='Next';

</script>

<script src='http://scriptabufarhan.googlecode.com/svn/trunk/pagenaviv202-min.js' type='text/javascript'></script>


Here you can change Prev and Next Text.

var postperpage=7;

var numshowpage=4;
Postperpage : How many Posts you want to show on one Page of blog.

Numshowpage : how Many number will show in Your page Navigation



e.g. If you want to show 5 posts per page then change var postperpage=7; to var postperpage=5;



Save your Template.





STEP 3 - Label Fix (Customization)



Again go to Blogger Dashboard > Layout > Edit HTML. This time Click on Expand Widget templates.

Look for

'data:label.url'
And replace it with

'data:label.url + &quot;?&amp;max-results=7&quot;'
Again here you have to change 7 to 5 if you want to show 5 posts per page.



Save your template and view your blog.

14 thg 3, 2011

Hiển thị thời gian tải trang cho blogger

Hôm nay, tuananhg sẽ hướng dẫn các bạn tạo một widget đơn giản hiển thị thời gian tải trang web của bạn.

-Bước 1: Đăng nhập vào blogger –>Thiết kế–>Chỉnh sửa HTML ( đánh dấu check vào Mở rộng Mẫu Tiện ích ), sau đó tìm kiếm ( Ctrl + F ) với <head>. Copy đoạn code bên dưới và paste vào phía dưới thẻ <head>





<!--Star Page load timer -->
<script type='text/javascript'>
var d = new Date();
var starttime = d.getTime();
</script>
<!-- End Page load timer -->


-Bước 2: Tìm đến thẻ </body> và copy đ0ạn code bên dưới vào trước thẻ </body>



<!-- START page load timer  -->
<script type='text/javascript'>
var d2 = new Date();
var endtime = d2.getTime();
var totaltime = (endtime - starttime)/1000;
var result = Math.round(totaltime*100)/100;
document.getElementById(&quot;loadtime&quot;).innerHTML = &quot;Page loaded in: &quot;+ result +&quot; seconds&quot;;
</script>
<!-- END page load timer -->

Vậy là đã gần xong, click vào Lưu Mẫu

photo
Bậy giờ các bạn vào Phần tử trang –>Thêm tiện tích loại HTML/JavaScript và copy code bên dưới vào.

<p id="loadtime">mothuthuat.com</p>
Chúc các bạn thành công !

Nguồn mothuthuat.com

10 thg 10, 2010

Recent post with thumbnails widget for Blogger

 



Displaying small thumbnail images adjacent to post titles in the recent post widget on blogs not only looks nice, but also entice visitors to click on your posts. So how to do it in Blogger? Blog The MLxperience has put together a beautiful working script. This is how to implement it on your blog.



Create a new HTML widget and copy paste the following code:



<script language="JavaScript">
imgr = new Array();

imgr[0] = "http://YOURIMAGEURL1.jpg";
imgr[1] = "http://YOURIMAGEURL2.jpg";
imgr[2] = "http://YOURIMAGEURL3.jpg";
imgr[3] = "http://YOURIMAGEURL4.jpg"; 


showRandomImg = true;

tablewidth = 248;
cellspacing = 8;
borderColor = "#ffffff";
bgTD = "#ffffff";

imgwidth = 118;
imgheight = 100;

fntsize = 12;
acolor = "#666";
aBold = true;
icon = " ";

text = "no";

showPostDate = false;

summaryPost = 50;
summaryFontsize = 11;
summaryColor = "#666";
icon2 = " ";

numposts = 5;

home_page = "YOUR BLOG URL";

</script>
<script src="http://recent-post-thumbnail.googlecode.com/files/recentposts_thumbnail.js" type="text/javascript"></script>



 


There are many variables in this script that you need to adjust to blend the widget’s look with that of your blog template. Most of them are self explanatory.



  1. "http://YOURIMAGEURL.jpg" and its array should be set to your uploaded images that will display if you post an article without an image. You can add a bunch of images to this array and anyone of it will be picked up at random. If you always include at least one image on every post, this array is not required and can be left untouched.

  2. YOUR BLOG URL should be replaced with the actual URL. Add a trailing slash (/)at the end of the URL. Example: http://www.instantfundas.com/

  3. To display the number of comments each post has change remove "no" from text = "no";

  4. Play with the width, color etc to match your blog template. It should be noted that widget is based purely on tables and no CSS is used.


How to further customize the widget


recent-post-ver recent-post-thumb-ver1 recent-post-thumb-hor


This particular Javascript file generates a recent post widget with thumbnails on the left and post titles on the right. But you can change the position of the different elements of the widget as shown in the screenshots above. Here are some live examples:


- Horizontal widget instead of vertical (live example on the author’s blog ) 
- Post title at the top of thumbnails (another example).


Update: You will find the JavaScript files for the horizontal widget and post title on top widget at the project's homepage at Google Code


 


This is how to do it. Open the Javascript file in a text editor. Towards the end of the script you will find the following code:



var trtd = '<tr><td valign="top" width="'+imgwidth+'" height="'+imgheight+'" style="background:'+bgTD+'"><a href="'+posturl+'"><img src="'+img[i]+'" width="'+imgwidth+'" height="'+imgheight+'"/></a></td>
<td style="background:'+bgTD+'" valign="top">'+icon+'<a href="'+posturl+'" style="color:'+acolor+'; font-size:'+fntsize+'px;">'+posttitle+'</a><br /> '+cmtext+ ' ' + daystr + '<div style="color:'+summaryColor+'; margin-top:2px; border-top:1px '+borderColor+' solid; font-size:'+summaryFontsize+'px;">'+icon2+removeHtmlTag(postcontent,summaryPost)+'...</div></td></tr>';

if(summaryPost == 0) { trtd = '<tr><td valign="top" width="'+imgwidth+'" height="'+imgheight+'" style="background:'+bgTD+'"><a href="'+posturl+'"><img src="'+img[i]+'" width="'+imgwidth+'" height="'+imgheight+'"/></a></td>
<td style="background:'+bgTD+'" valign="top">'+icon+'<a href="'+posturl+'" style="color:'+acolor+'; font-size:'+fntsize+'px;">'+posttitle+'</a><br /> '+cmtext+ ' ' + daystr + '</td></tr>'; }



 


This is the code that renders the table. The first <td> houses the thumbnail image. The second <td> houses the post title. If the code looks confusing to you, don’t worry, you don’t even have to know how it works.


Just create a new table and move the exact codes between the <td> and </td> tags to the desired cells, paying attention to correctly specify the width/height of the cells either using absolute values or the variables ‘+imgwidth+' and +’imgheight+'. You don’t have to create the complete table, just the first one or two cell depending upon how you have designed it. These cells will be repeated for each new post. If you know how to create tables in HTML it’s pretty straightforward.


 


 

19 thg 9, 2010

15 Free Premium Blogger Templates

Đây là bộ sưu tập các premium blogger templates mà blogviet đã thu thập từ các nguồn khác nhau có sự chọn lọc theo “gu” của mình. Có thể nhiều bạn sẽ không thích vì khiếu thẩm mỹ của mỗi người đều không giống nhau. Hy vọng các bạn sẽ tìm được cái mà mình đang cần. Nhiều blogger templates là những bản clone từ các premium wordpress mà mình rất thích như Falker Press hay Typebased….


Nếu các bạn có những blogger templates hay nào do mình thiết kế thì có thể chia sẻ với mình để mình có thể tổng hợp và giới thiệu trong các bài tiếp theo nhé.


1. Zitizen:



DEMO | Download


2. Woody:



DEMO | Download


3. Typebased:



DEMO | Download


4. Travel & Tour:



DEMO | Download


5. The Latest:



DEMO | Download


6. SCHEMAR MAG:



DEMO | Download


7. MobiPress:



DEMO | Download


8. Mahusay Blogger Template:



DEMO | Download


9. Falkner Press:



DEMO | Download


10. Dreamy:



DEMO | Download


11. Conservative:



DEMO | Download


12. Community:



DEMO | Download


13. Business Talk:



DEMO | Download


4. Acosmintech:



DEMO | Download


15. Mainstream:


 



 


DEMO | Download


Nguồn: eblogviet.com

15 thg 6, 2010

Tự thiết kế theme cho Blogger với chức năng Template Design

Nếu bạn để ý trong Dashboard của blogger.com , bạn sẽ nhận ra ngay blogger đã hỗ trợ thêm chức năng Design trực tiếp cho blogger. Có thể nói đây là cải tiến rất mới và thuận lợi cho người sử dụng khi Google đã quyết định đưa vào để tăng thị phần người dùng platform blogger – Đối thủ số 1 của wordpress hiện nay.






template design


template design


Hướng dẫn sử dụng :


Trong vùng 1 , tại chức năng Templates , sẽ có 1 số template cơ bản cho bạn:


template design


Tại menu Background : cho phép thay đổi hình nền, màu sắc chủ đạo của nền.


Có rất nhiều chủ đề cho bạn lựa chọn như Abstract,The Arts,Bussiness…


template design


Tại menu Layout : Sẽ có 3 lựa chọn chính mà với 3 lựa chọn này, bạn có thể làm được rất nhiều, có thể biến nó thành 1 web, blog chuyên nghiệp, có thể chia footer thành nhiều phần, tùy chính kích thứoc sidebar,…


template design


template design


template design


Tại menu nâng cao Advanced : Là những tùy chọn cơ bản cho Title,post,gadget,….


template design


 


Theo nhận định ban đầu của mình khi sử dụng thử chức năng mới này cho thấy:


Ưu điểm:



  • Dễ sử dụng,giao diện trực quan

  • Hỗ trợ một số template mặc định khá đẹp, gọn và nhẹ.

  • Tương tác với người dùng tốt

  • Hạn chế chỉnh sửa tại mã html để tránh những tủi ro đáng tiếc cho những blogger không có kiến thức tốt về html


Nhược điểm :



  • Còn hạn chế về mặt template chuyên nghiệp,..


Nhưng với từng ấy chức năng cơ bản là đã có thể giúp cho một blogger mới trở thành những chủ nhân của các blog chuyên nghiệp. Nếu bạn chưa biết đến chức năng này , hãy áp dụng nó ngay đi, sẽ có nhiều điều đang chờ bạn khám phá.


Chúc bạn thành công và sớm có 1 mảnh đất tâm hồn trên Internet :)


(Theo Blog Thủ Thuật)

23 thg 5, 2010

Tạo Featured Content Slide bằng tay (dùng cho BlogSpot, uCoz,Wordpress...)





Hiện nay có khá nhiều blog sử dụng chức năng Featured Content (tiếng việt có thể dịch tạm là "Bài viết nổi bật", "Bài viết được quan tâm" gì gì đó :D...). Với những blog sử dụng mã nguồn Wordpress, Joomla... thì việc nhúng chức năng này vào blog khá dễ dàng với các Plug-in hoặc Add-on hỗ trợ sẵn... Tuy nhiên không phải ai cũng biết đến chúng... Và nếu như blog của bạn không sử dụng những platform này thì.... đành chịu sao? Nhưng bạn hãy yên tâm, với các platform như Blogger hay uCoz, bạn cũng có thể làm được Featured Content Slide bằng cách sử dụng mã Javascript và nội dung tự tạo bằng tay, trông cũng có vẻ ấn tượng không kém đâu!



Bạn có thể xem trước demo ở đây. Nếu thấy hài lòng thì bây giờ chúng ta bắt đầu nhé...



Đầu tiên bạn chèn đoạn code sau trước thẻ </head>






<link rel="stylesheet" type="text/css" href="http://demo.b3smile.co.cc/html/featured-content-slider/contentslider.js" />



<script type='text/javascript' src='http://demo.b3smile.co.cc/html/featured-content-slider/contentslider.js'></script>





Sau đó, tìm đến nơi cần hiển thị Featured Content, chèn đoạn code này vào:






<h3 style="margin: 0 0 7px 0; padding: 0 7px 7px 0; color: #000; font-size: 1.4em; font-weight: bold; border-bottom: 1px solid #999999; text-transform: uppercase;font-family:tahoma,verdana,arial">Featured Posts



<div id="paginate-slider1" class="pagination"></div></h3>



<!--begin: featured_content -->

<div id="slider1" class="sliderwrapper">



<div class="contentdiv">



<h2><a href="POST URL 1" title="POST TITLE 1">POST TITLE 1</a></h2>



<div class="desc">



<img alt="POST TITLE 1" src="POST IMG THUMBNAIL 1" />POST CONTENT 1</div>



<div class="more"><a href="POST URL 1" title="POST TITLE 1">Read More...</a></div>



</div>



<div class="contentdiv">



<h2><a href="POST URL 2" title="POST TITLE 2">POST TITLE 2</a></h2>



<div class="desc">



<img alt="POST TITLE 2" src="POST IMG THUMBNAIL 2" />POST CONTENT 2</div>



<div class="more"><a href="POST URL 2" title="POST TITLE 2">Read More...</a></div>



</div>



<!-- More post here... --->



</div><!--end: featured_content -->



<script type="text/javascript">



featuredcontentslider.init({



id: "slider1",  //id of main slider DIV



contentsource: ["inline", ""],  //Valid values: ["inline", ""] or ["ajax", "path_to_file"]



toc: "#increment",  //Valid values: "#increment", "markup", ["label1", "label2", etc]



nextprev: ["<img width=8 src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8cKQ96x0jdO_uncYkDXPzudLLbIJlp9jmDYH6B-ViaW1CAZMtGyzn1DKvJbnCKoMzQdYFuw_6Rzg6WOOM3Y6cbsx5PXpr19wqxWxP4m-1P4cfZpsxeNx2DzWhNNFJXeqzhwpFjfluGxJC/s1600/prev.png' height=7 />", "<img width=8 src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtQ0Rmr4dotwf8lGpVrxXtSuuCtAFhIBaKT8vmyM84AI8vcCGqIe4rvDNizXj28_pQuLjNOmyD4jJNTo-UD7xU1xhw4jM1k2MkEjLbDFnEJRLEl5XsLKbm3yXvm0LWTTqSfYAMydoN5UUs/s1600/next.png' height=7 />"],  //labels for "prev" and "next" links. Set to "" to hide.



revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"



enablefade: [true, 0.2],  //[true/false, fadedegree]



autorotate: [true, 10000],  //[true/false, pausetime]



onChange: function(previndex, curindex){ }



})



</script>





Các thông số cần chỉnh sửa:



Về phần nội dung:





  • POST URL 1(2, 3...): liên kết đến bài viết 1 (2, 3...)



  • POST TITLE 1 (2, 3...): tiêu đề bài viết



  • POST IMG THUMBNAIL 1 (2, 3...): url đến ảnh minh họa cho bài viết



  • POST CONTENT 1 (2, 3...): nội dung ngắn gọn mô tả bài viết



  • <!-- More post here... --->: bạn có thể chèn thêm nhiều bài viết nữa cho Slide vào đây, nhớ định dạng theo mẫu nằm trong thẻ  <div class="contentdiv">....</div> như trên là được




Về phần hiển thị:





  • revealtype: cách chuyển nội dung, có 2 lựa chọn là "click" và "mouseover". Bạn thử từng tùy chọn sẽ thấy kết quả



  • enablefade: cho phép có hiệu ứng bóng mờ khi chuyển slide hay không. Giá trị là [true/false, độ mờ]



  • autorotate: cho phép tự động chuyển slide hay không. Giá trị là [true/false, thời gian hiển thị từng slide]



  • Các thông số còn lại như id, contentsource, toc... bạn nên giữ mặc định hết là được




Download toàn bộ code






http://www.mediafire.com/?vi0yiz56b0lxy12




Chúc các bạn thành công!



Mọi vấn đề thắc mắc xin gửi comment tại đây cho mình nhé. Thanks.