Chức năng mới rất hay gần giống php.
Sau đây hướng dẫn các bạn sử dụng chức năng này để chuyển đổi giao diện wap/web.
Cần tạo 3 file html, lấy ví dụ là index nhé:
+ index
+ web_index
+ mobile_index
Chèn code này vào file index :
<!--parser:xtscript-->
assign $device=<xt:get_device_template />_index
assign $site=<xt:url type="domain" />
print <script type="text/javascript">location.href='http://$site/$device';</script>
print <meta http-equiv="refresh" content="0;http://$site/$device" />
<!--/parser:xtscript-->
Được oy truy cập từ ĐT nó chuyển sang mobile_index truy cập từ PC nó chuyển sang web_index muốn thiết kế thế nào thì tùy hoa tay.
Chú ý: 2 file này dùng css riêng! Nếu muốn dùng css chung thì: Tạo 2 file css cho wap và web đặt tên là:
+ mobile.css
+ web.css
Chèn code này vào _headtags hoặc _header cũng được: