Admin

AdminAdmin is verified member.

Well-Known Member
Staff member
Administrator
Chèn code sau vào file _header:
HTML:
<xt:code>
<!--parser:xtscript-->
assign $device=<xt:get_device_template />
assign $1={{<xt:include file="/header-web" />
}}
assign $2={{<xt:include file="/header-mobile" />
}}
if $device=web
print $1
else
print $2
endif
<!--/parser:xtscript-->
</xt:code>
Sau đó chèn nội dung vào files header-web và header-mobile
Làm tương tự vs footer.
Notes:
- Code đã test thành công nhưng demo của mình chưa chèn nội dung nên mình ko pub lên.
- Chắc chắn sẽ có bạn hỏi tại sao mình ko print thẳng là
HTML:
<xt:include file=/heade-web" />
mà lại gán biến $1 cho cái đám ấy. Mình cũng xin tl thật tình là mình ko biết :D vì print thẳng như thế sẽ bị lỗi.
- Xtscript là một nnlt rất hay của xtgem, m.n nên tham khảo cái này để làm wap pro hơn.
- Sắp tới mình sẽ share code tạo giao diện 2 cột, 3 cột (không phải là table đâu vì table ko đúng với standard web), banner quảng cáo chạy dọc hai bên và một số dropdown menu đẹp mình sưu tầm được (cho giao diện web)
 
Không, xtscript mà em
 
Đã bảo là xtscript, javascript gì ở đây, nản thật
 
Ko? Em thấy ko hỗ trợ js thì làm gì xài đc code này?
 

Facebook Comments

Similar threads

Admin
Replies
2
Views
3K
DavidC
DavidC
Admin
Replies
0
Views
2K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
1K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
966
AdminAdmin is verified member.
Admin
Admin
Replies
6
Views
2K
Young
Y
Y
Replies
4
Views
1K
blog4meblog4me is verified member.
blog4me
Admin
Replies
4
Views
1K
KullsTyLe
KullsTyLe
Admin
Replies
1
Views
3K
KullsTyLe
KullsTyLe
Back
Top