Other 2x Make collapsible sub-forums of a forum with no parent in forum list - Tạo sub-forum thu gọn của diễn đàn không có parent trong forum list XenForo 2

PVS

Super Moderator
Thành viên BQT
Tham gia
28/02/2015
Bài viết
16,827
Được Like
12,687
Make collapsible sub-forums of a forum with no parent in forum list - Tạo sub-forum thu gọn của diễn đàn không có parent trong forum list XenForo 2

Trong forum list, Khi bạn có một danh sách dài các sub forum, bạn thường muốn chúng thu gọn vào một danh sách sub forum.

Tuy nhiên, theo mặc định, chúng chỉ thu gọn khi ở cấp thứ ba:
category>forum>sub-forum list.
hoặc
forum>sub-forum>sub-forum list.

Trong diễn đàn, không phải tất cả các diễn đàn đều có một category - đôi khi diễn đàn parent cũng là một category.
Nhưng vì các diễn đàn không có category nào được coi là cấp độ đầu tiên nên các sub-node của chúng sẽ không bị sập:
forum>sub-forums.

Các template modifications này sẽ khắc phục được :)

2 template modifications đơn giản:

1) Thêm template modification.
a. Chọn template node_list_forum.
b. Đối với Modification Key, hãy chọn: make_sub_nodes_collapse_step1
c. Thêm mô tả ngắn: Làm cho các nút con thu gọn trong danh sách nút - Bước 1
d. Tìm kiếm văn bản:
HTML:
<xf:macro template="forum_list" name="sub_nodes_menu"
                            arg-children="{$children}"
                            arg-childExtras="{$childExtras}"
                            arg-depth="{{ $depth + 1 }}" />
e.Thay bằng:
HTML:
$0
                    <xf:elseif is="$depth == 1 AND property('nodeListSubDisplay') == 'menu'" />
                        <xf:macro template="forum_list" name="sub_nodes_menu"
                            arg-children="{$children}"
                            arg-childExtras="{$childExtras}"
                            arg-depth="{{ $depth + 1 }}" />
f. Lưu và thêm template modification thứ hai:

2) Thêm template modification.
a. Chọn template node_list_forum.
b. Đối với Modification Key, hãy chọn: make_sub_nodes_collapse_step2
c. Thêm mô tả ngắn: Làm cho các nút con thu gọn trong danh sách nút - Bước 2
d. Tìm kiếm văn bản:
HTML:
    <xf:if is="{$depth} == 1">
        <xf:macro template="forum_list" name="node_list"
            arg-children="{$children}"
            arg-extras="{$childExtras}"
            arg-depth="{{ $depth + 1 }}" />
    </xf:if>
e.Thay bằng:
HTML:
<xf:comment>
$0
</xf:comment>
f. Lưu và tận hưởng.

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


Nguồn: xenforo.com​
 

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

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mr. Tuấn

Mobile/Zalo: 0988 488 096

Telegram: bluekpro

Email: [email protected]

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Top Bottom