* GistBirD I want to create different header and footer for mobile and Web version.
have try <xt:include file="/<xt:get_device_template" />_header, after creating a file named mobile_header and web_header but didn't work.
2014-12-02 05:57 · (0)
* onedc * GistBirD In my observation and i have also try your problem. i think Xtgem function (get device template) cannot be parse in Xt:include because xt:include is parsed before xt:functions.. because of that the get device template will not be printed as 'mobile' or 'web' in the xt:include.. so thats why it is not working.
2014-12-03 14:15 (edited 2014-12-03 14:22 by onedc ) · (1)
* onedc The solution: try this :) i have made it using xt:script
<!--parser:xtscript-->
var $header = <xt:get_device_template /> 
if $header == mobile
assign $header = <xt:include file="/mobile_header" />
elseif $header == touch
assign $header = <xt:include file="/touch_header" /> 
elseif $header  == web
assign $header = <xt:include file="/web_header" /> 
endif
print $header
<!--/parser:xtscript-->

Copy code
2014-12-03 15:07 (edited 2014-12-03 15:13 by onedc ) · (1)
* Graham * onedc or this
it will look for web_header - touch_header - mobile_header one problem for this is due to the way source works you need to add another function for each layer of directories that contain html pages
The files must be plain text and can contain anything except more xtscript
<!--parser:xtscript-->
var $dev=<xt:get_device_template />
var $base=_header
call source $file=/$dev$base
call source $file=../$dev$base
call source $file=../../$dev$base
<!--/parser:xtscript-->

Copy code
2014-12-03 15:28 (edited 2014-12-03 15:40 by Graham ) · (1)
* GistBirD It works fine, thanks.
really appreciate
2014-12-03 22:28 · (0)

Online: Guests: 1