• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Admin

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)
 
Đã bảo là xtscript, javascript gì ở đây, nản thật
 

Facebook Comments

New posts New threads New resources

Back
Top