Pernahkah anda melihat ruangan komen di blog rakan-rakan anda yang tersusun kemas seperti di blog WordPress? Contohnya adalah seperti di gambar ini.
Buat pengetahuan anda. Ini adalah fungsi "Threaded Comment". Biasanya anda boleh lihat di blog-blog yang menggunakan platform WordPress. "Threaded Comment" ni mempunyai kelebihan, di mana kita tidak lagi perlu memasukkan fungsi "Reply to Comment" secara berasingan. Ini kerana di dalam tutorial ini sudah terdapat code untuk butang "Reply to Comment".
Coding bagi "Threaded Comment" ini telah diubahsuai oleh saya. Di mana saya telah menambahkan sedikit customization pada code CSS "Threaded Comment" ini. Tutorial asal bagi "Threaded Comment " ini adalah dari blog Mari Bina Blog.
Langkah-langkah pemasangan
Okay, sekarang kita teruskan dengan cara-cara untuk mengaplikasikan sistem "Threaded Comment" ke dalam blog.
- Sila Log In / Sign In ke Dashboard anda.
- Sila pilih Template > Edit HTML (Bagi mereka yang menggunakan interface baru) Selepas itu sila klik Proceed.
- Sila pilih Design > Edit HTML (Bagi mereka yang menggunakan interface lama).
- Sila tick pada bahagian "Expand Widget Template".
- Sila cari code ]]></b:skin> dengan menggunakan button "Ctrl + F". Kemudian copy dan paste code di bawah ini sebelum code ]]></b:skin>.
CSS Code Threaded Comment:
#comments h4 {
font-size: 24px;
font-weight: normal;
margin: 20px 0;
}
.cm_wrap {
clear: both;
margin-bottom: 10px;
float: right;
width: 100%;
}
.cm_head {
margin: 0;
width: 70px;
float: left;
}
.cm_avatar {
margin: 0;
vertical-align: middle;
border: 1px solid #DDD;
padding: 3px;
background: white;
width: 35px;
height: 35px;
}
.cm_reply {
padding-top: 5px;
}
.cm_reply a {
display: inline-block;
margin: 0;
padding: 1px 6px;
border: 1px solid #C4C4C4;
border-top-color: #E4E4E4;
border-left-color: #E4E4E4;
color: #424242 !important;
text-align: center;
text-shadow: 0 -1px 0 white;
text-decoration: none;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #EDEDED;
background: -webkit-gradient( linear, left top, left bottom, color-stop(.2, white), color-stop(1, #E5E5E5) );
background: -moz-linear-gradient( center top, white 20%, #E5E5E5 100% );
font: 11px/18px sans-serif;
}
.cm_reply a:hover {
text-decoration: none !important;;
background: #ccc;;
background: -webkit-gradient(linear,left top,left bottom,color-stop(.2, #eeeeee),color-stop(1, #cccccc));;
background: -moz-linear-gradient(center top,#eeeeee 20%,#cccccc 100%);;
}
.cm_entry {
padding: 16px;
background: #fff;
border: 1px solid #E4E4E4;
overflow: hidden;
-webkit-box-shadow: 0 0 10px #000000;
-webkit-border-radius: 5px;
}
.cm_entry_admin {
padding: 16px;
background: #0000FF;
border: 1px solid #E4E4E4;
overflow: hidden;
color: #fff;
text-align:justify;
font-weight:normal;
-webkit-box-shadow: 0 0 10px #000000;
-webkit-border-radius: 5px;
}
.cm_arrow {
display: block;
width: 9px;
height: 18px;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj377gYMmZOtXTq3z6LKJBVmriy7iTFJTOf9SQ5aQYeI2GaVF346oDExOF0FMMcrf4jwKRZFH_HRWAiPfqf8MLaxhpm4_rT-w7AEgJowtko7MrUZAJqq1VhijVls1W_3ARtcUqGyweVdyo/s1600/comment-arrow.gif) no-repeat;
position: absolute;
margin-left: -25px;
}
.cm_info {
margin-bottom: 5px;
}
.cm_name {
font-weight: bold;
font-size: 12px;
float: left;
color:#000;
}
.cm_date {
font-size: 10px;
float: right;
font-style: italic;
color: #000;
}
.cm_entry p {
margin: 0;
font-size: 13px;
color: #000;
text-align:justify;
font-family:Segoe Print;
border: 1px solid #E4E4E4;
background:#fff;
padding:5px 5px 5px 5px;
-webkit-box-shadow: 0 0 10px #000000;
-webkit-border-radius: 5px;
}
.cm_entry_admin p {
margin: 0;
font-size: 13px;
color: #000;
text-align:justify;
font-family:Segoe Print;
border: 1px solid #E4E4E4;
background:#fff;
padding:5px 5px 5px 5px;
-webkit-box-shadow: 0 0 10px #000000;
-webkit-border-radius: 5px;
margin-top:5px;
}
.cm_pagenavi {
font-size: 10px;
text-transform: uppercase;
color: #666;
text-shadow: 1px 1px white;
font-weight: bold;
}
.cm_pagenavi a {
color: #666;
text-decoration: none;
padding:10px;
}
.cm_pagenavi a:hover {
text-decoration: underline
}
.cm_pagenavi span {
color: #888;
background: white;
padding: 4px;
border: 1px solid #E0E0E0;
}
font-size: 24px;
font-weight: normal;
margin: 20px 0;
}
.cm_wrap {
clear: both;
margin-bottom: 10px;
float: right;
width: 100%;
}
.cm_head {
margin: 0;
width: 70px;
float: left;
}
.cm_avatar {
margin: 0;
vertical-align: middle;
border: 1px solid #DDD;
padding: 3px;
background: white;
width: 35px;
height: 35px;
}
.cm_reply {
padding-top: 5px;
}
.cm_reply a {
display: inline-block;
margin: 0;
padding: 1px 6px;
border: 1px solid #C4C4C4;
border-top-color: #E4E4E4;
border-left-color: #E4E4E4;
color: #424242 !important;
text-align: center;
text-shadow: 0 -1px 0 white;
text-decoration: none;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #EDEDED;
background: -webkit-gradient( linear, left top, left bottom, color-stop(.2, white), color-stop(1, #E5E5E5) );
background: -moz-linear-gradient( center top, white 20%, #E5E5E5 100% );
font: 11px/18px sans-serif;
}
.cm_reply a:hover {
text-decoration: none !important;;
background: #ccc;;
background: -webkit-gradient(linear,left top,left bottom,color-stop(.2, #eeeeee),color-stop(1, #cccccc));;
background: -moz-linear-gradient(center top,#eeeeee 20%,#cccccc 100%);;
}
.cm_entry {
padding: 16px;
background: #fff;
border: 1px solid #E4E4E4;
overflow: hidden;
-webkit-box-shadow: 0 0 10px #000000;
-webkit-border-radius: 5px;
}
.cm_entry_admin {
padding: 16px;
background: #0000FF;
border: 1px solid #E4E4E4;
overflow: hidden;
color: #fff;
text-align:justify;
font-weight:normal;
-webkit-box-shadow: 0 0 10px #000000;
-webkit-border-radius: 5px;
}
.cm_arrow {
display: block;
width: 9px;
height: 18px;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj377gYMmZOtXTq3z6LKJBVmriy7iTFJTOf9SQ5aQYeI2GaVF346oDExOF0FMMcrf4jwKRZFH_HRWAiPfqf8MLaxhpm4_rT-w7AEgJowtko7MrUZAJqq1VhijVls1W_3ARtcUqGyweVdyo/s1600/comment-arrow.gif) no-repeat;
position: absolute;
margin-left: -25px;
}
.cm_info {
margin-bottom: 5px;
}
.cm_name {
font-weight: bold;
font-size: 12px;
float: left;
color:#000;
}
.cm_date {
font-size: 10px;
float: right;
font-style: italic;
color: #000;
}
.cm_entry p {
margin: 0;
font-size: 13px;
color: #000;
text-align:justify;
font-family:Segoe Print;
border: 1px solid #E4E4E4;
background:#fff;
padding:5px 5px 5px 5px;
-webkit-box-shadow: 0 0 10px #000000;
-webkit-border-radius: 5px;
}
.cm_entry_admin p {
margin: 0;
font-size: 13px;
color: #000;
text-align:justify;
font-family:Segoe Print;
border: 1px solid #E4E4E4;
background:#fff;
padding:5px 5px 5px 5px;
-webkit-box-shadow: 0 0 10px #000000;
-webkit-border-radius: 5px;
margin-top:5px;
}
.cm_pagenavi {
font-size: 10px;
text-transform: uppercase;
color: #666;
text-shadow: 1px 1px white;
font-weight: bold;
}
.cm_pagenavi a {
color: #666;
text-decoration: none;
padding:10px;
}
.cm_pagenavi a:hover {
text-decoration: underline
}
.cm_pagenavi span {
color: #888;
background: white;
padding: 4px;
border: 1px solid #E0E0E0;
}
Post a Comment