Thủ thuật để hiển thị comment form lên trước các nhận xét
Friday, 23 April 2010
Trong thiết kế mặc định phần các nhận xét (Comment block) hiển thị phía trên khung nhận xét (comment form) để bạn đọc có thể tham khảo các nhận xét trước để đưa ra các ý kiến trong nhận xét của mình, tuy nhiên một số chủ nhân không quan tâm đến điều đó và muốn đặt comment form lên trước các nhận xét để người đọc dễ dàng nhận xét không phải mất thời gian cuộn qua các nhận xét đã có.- VnBlognet [dot] com: Cách thực hiện thủ thuật này tương đối đơn giản. Nhưng trước hết mời các bạn xem hình minh họa của thủ thuật này.
Với thiết kế mặc định:
Comment block hiển thị phía trên Comment form
Sau khi thực hiện thủ thuật:
Comment form hiển thị phía trên Comment block
Cách thực hiện thủ thuật này như sau:
- Truy cập vào Blogger
Bảng điều khiển (Dashboard) >>
Bố cục (Layout) >>
Chỉnh sửa HTML (Edit HTML). và click và ô chọn
Mở rộng mẫu tiện ích (Expand Widget Templates)
- Phần cuối bài viêt
- Tìm (Ctrl-F) đoạn code hiển thị Form Comment
<p class='comment-footer'>
<b:if cond='data:post.embedCommentForm'>
<b:if cond='data:post.allowNewComments'>
<b:include data='post' name='comment-form'/>
<b:else/>
<data:post.noNewCommentsText/>
</b:if>
<b:else/>
<b:if cond='data:post.allowComments'>
<a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:postCommentMsg/></a>
</b:if>
</b:if>
</p>
- Di chuyển phần code (
in đậm màu xanh) nằm trong thẻ
<p class='comment-footer'> …….. </p> đã tìm trong bước 2 xuống dưới đoạn code sau:
<b:includable id='comments' var='post'>
<div class='comments' id='comments'>
<a name='comments'/>
<b:if cond='data:post.allowComments'>
<h4>
<b:if cond='data:post.numComments == 1'>
1 <data:commentLabel/>:
<b:else/>
<data:post.numComments/> <data:commentLabelPlural/>:
</b:if>
</h4>
Khi đó code sẽ có dạng:
<b:includable id='comments' var='post'>
<div class='comments' id='comments'>
<a name='comments'/>
<b:if cond='data:post.allowComments'>
<h4>
<b:if cond='data:post.numComments == 1'>
1 <data:commentLabel/>:
<b:else/>
<data:post.numComments/> <data:commentLabelPlural/>:
</b:if>
</h4>
<b:if cond='data:post.embedCommentForm'>
<b:if cond='data:post.allowNewComments'>
<b:include data='post' name='comment-form'/>
<b:else/>
<data:post.noNewCommentsText/>
</b:if>
<b:else/>
<b:if cond='data:post.allowComments'>
<a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:postCommentMsg/></a>
</b:if>
</b:if>
Lưu ý:
1. Có thể các mẫu có sự khác nhau về câu lệnh code chút ít nhưng về cơ bản bạn tìm các tag tương tự.
2. Nếu muốn thực hiện quy trình ngược lại chuyển Comment form hiển thị phía trên Comment block thì bạn làm ngược theo hướng dẫn trên.
CHÚC CÁC BẠN THÀNH CÔNG !!!
Tags:
Breakingnews,
Comment,
Khoi tao Blog
Ý kiến bạn đọc [ 6 ]
anh chinh em mún làm comment như bên blogtruyện khi comment thì nếu là admin thì dằng sau lên comemt hiện chữ admin màu đõ thì phãi làm sao hã anh
Cám ơn bạn quan tâm, yêu cầu của bạn mình đã thể hiện trong bài Làm nổi bật nhận xét của Admin – Highlight Author đăng tại http://www.vnblognet.com/2009/12/lam-noi-bat-nhan-xet-cua-ban-highlight.html
cảm ơn bác em đã làm thử và tháy cũng hay
cszc
em ko hieu kai doan hien thi comment
neu em muon copy code html de vao trang cua em thi lam kieu gi ak
Ý kiến của bạn