Tutorial 2x [Widget] Display Random Quotations/FAQs - Tạo widget hiển thị ngẫu nhiên trích dẫn/FAQ cho XenForo 2

PVS

Super Moderator
Thành viên BQT
Tham gia
28/02/2015
Bài viết
16,728
Được Like
12,680
[Widget] Display Random Quotations/FAQs - Tạo widget hiển thị ngẫu nhiên trích dẫn/FAQ cho XenForo 2

Hiển thị trích dẫn yêu thích hoặc câu hỏi thường gặp ở bất cứ đâu trong diễn đàn bằng widget!

Cách làm như sau:

Đến Widgets > Add Widgets > HTML Widget

- Widget definition: HTML

- Widget key: quotes

- Title: Trích dẫn hoặc câu hỏi thường gặp

- Display in positions: Chọn một hoặc nhiều vị trí bạn muốn

- Display condition: Không bắt buộc

- Template:
Mã:
<font size=2; color="darkviolet";>
    <xf:comment>Random Quotes/Quotations</xf:comment>
    <xf:set var="$quote.1">Your Quote Goes Here! 1</xf:set>
    <xf:set var="$quote.2">Your Quote Goes Here! 2</xf:set>
    <xf:set var="$quote.3">Your Quote Goes Here! 3</xf:set>
    <xf:set var="$quote.4">Your Quote Goes Here! 4</xf:set>
    <xf:set var="$quote.5">Your Quote Goes Here! 5</xf:set>
    <xf:set var="$quote.6">Your Quote Goes Here! 6</xf:set>
    <xf:set var="$quote.7">Your Quote Goes Here! 7</xf:set>
    <xf:set var="$quote.8">Your Quote Goes Here! 8</xf:set>
    <xf:set var="$quote.9">Your Quote Goes Here! 9</xf:set>
    <xf:set var="$quote.X">Your Quote Goes Here! 10</xf:set>
    {$quote.{{ ($xf.time % X) + 1 }}|raw}
</font>

Trong đó X = Tổng số trích dẫn hoặc câu hỏi, ví dụ: 10 trong ví dụ trên;

- Lưu lại và thưởng thức.

Screen Shot 2019-06-23 at 3.42.17 PM.png


Screen Shot 2019-06-23 at 3.41.02 PM.png

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