MacKen
Sergeant
Đầu tiên các bạn chèn đoạn script sau vào cuối template thread_list_item
Mã:
Để ý số 100 ở gần cuối. Đây là giới hạn ký tự cho đoạn text.
Sau đó cũng trong template này bạn paste đoạn sau vào nơi muốn hiện nội dung preview cho bài viết
Mã:
Mã:
Mã:
<script>
$.ajax({
type:'GET', url:'
{xen:if $thread.hasPreview, {xen:link threads/preview, $thread}}'
})
.done(function(result){
$('#discussionItem-{$thread.thread_id}') .html('<div class=\"discussionFirstItem\">'+$(result) .find('blockquote').html().substring(0,100)+'...</div>');
});
</script>
Để ý số 100 ở gần cuối. Đây là giới hạn ký tự cho đoạn text.
Sau đó cũng trong template này bạn paste đoạn sau vào nơi muốn hiện nội dung preview cho bài viết
Mã:
Mã:
<p id="discussionItem-{$thread.thread_id}"></p>
Bài viết liên quan
Được quan tâm