* Graham * Waplocus There are 2 main problems here plus a load of weird little ones
first xt:get_device_template only returns web or mobile it no longer returns touch
There is a workaround hack using the blog and a custom twig file to return the value of data.device from the blog data and that does detect 'touch' devices

The other main issue is xt:includes and their 'parsing order'
in a line like
print <xt:include file="/EXT/Web" /> the issue is that the includes are parsed BEFORE the xtscript so it tries to include the contents of the file into the xtscript before the script itself is parsed and that breaks the script
it breaks because the first line of the included file replaces the xt:include in the script and the rest is included below it so it 'prints' that first line but the rest fails (unless it is xtscript codes)
you can get it to work using
print {{<xt:include file="/EXT/Web" />}} but the file being included cannot contain any other xtscripts because the include is not performed until after the xtscript has finished

you could use the xtscript include but then the file being included must be a .xt xtscript file and written in xtscript syntax

the workaround for get_device template using the blog is this
rename your current xtblog.twig to blog.twig
create a new xtblog.twig file and set this code in it


you then use <xt:blog t_no_entries_found="device" /> instead of <xt:get_device_template />
2017-03-24 08:56 (edited 2017-03-24 09:09 by Graham ) · (0)

Online: Guests: 1