Tutorial 2x Thêm thanh phân loại danh sách node ngay bên dưới thanh tiêu đề category cho XenForo 2

[VNXF] Theme Digital – Sự lựa chọn hoàn hảo cho diễn đàn công nghệ hiện đại

PVS

Super Moderator
Thành viên BQT
Thêm thanh phân loại danh sách node ngay bên dưới thanh tiêu đề category cho XenForo 2

Vào template extra.less và thêm đoạn code sau:
Mã:
.node_list_item_classification {
    @media (max-width: @xf-responsiveEdgeSpacerRemoval) {display: none;}
    .xf-minorBlockContent();
    border: none; opacity: 0.5;
    &>.node-body {
        &>* {padding-top: @xf-paddingSmall; padding-bottom: @xf-paddingSmall;font-size:@xf-fontSizeNormal;}
        span.node-icon {opacity: 0; height: (1em * @xf-lineHeightDefault);}
    }
}

Tiếp theo vào template node_list_category và tìm <h2 class="block-header">.
Theo mặc định, bạn sẽ thấy kết thúc của block này ở dòng 8 và bạn thấy dòng tiếp theo bắt đầu block body: <div class="block-body">.

1589676316790.png

Thay thế toàn bộ block <div class="block-body"> (Từ dòng 9 đến 14) như sau:
Mã:
            <div class="block-body">
                <xf:if contentcheck="true">
                    <div class="node_list_item_classification node node--forum">
                        <div class="node-body">
                            <span class="node-icon" aria-hidden="true"><i></i></span>
                            <div class="node-main js-nodeMain">{{ phrase('forum') }}</div>
                            <div class="node-extra">{{ phrase('last_activity')}}</div>
                        </div>
                    </div>
                    <xf:contentcheck>
                        <xf:macro template="forum_list" name="node_list"
                            arg-children="{$children}"
                            arg-extras="{$childExtras}"
                            arg-depth="{{ $depth + 1 }}" />
                    </xf:contentcheck>
                </xf:if>
            </div>

Lưu lại là xong.

1589676338351.png

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


Nguồn: xenforo.com​
 
Back
Top