xtfunctions in xtscript
Xt functions
[...] = optional ... = your value
[var $... = ]<xt: ... />
[print[_raw]][...]<xt: ... />[...]
Example code
Show in textarea<!--parser:xtscript-->
# xtfunctions can be printed out
print you are using a <xt:get_device_template /> device<br />
# Most xtfunctions can be read into variables
var $country=<xt:country type="1" />
print $country<hr />
# forums cannot be read into xtscript variables
var $forum=<xt:forum />
print $forum no forum here <hr/>
#xtfunctions can be constructed with variables
var $function=browser detail="4"
var $browser=<xt:$function />
print $browser<hr />
# The content of a file can be included in to a variable
var $included = <xt:include file="/manual/basics/examples/included"/>
print $included<hr />
# widgets are parsed separately to Xtscript so they cannot be read into variables
var $widget=<xt:widget id="flickr_random_photo"/>
print $widget no widget here <hr/>
#but they can be constructed for output
var $w = flickr_random_photo
print <xt:widget id="$w"/><hr />
# dump of variables on this page
print Variables on this page <br />
var $dump=call dump_vars
var $dump=call trim $val=$dump ; $charlist={{<pre>
Array/ }}
var $dump=call trim $val=$dump ; $charlist=( )
var $dump=call htmlspecialchars $val=$dump
#var $dump=call nl2br $val=$dump
print <pre>$dump</pre>
<!--/parser:xtscript-->
Show in textarea Example output
Reloadyou are using a mobile device
no forum here
This file has been included in to a variable
no widget here
Variables on this page
[func] => xtfunctions_in_xtscript
[rnd] => 1088410298
[url] =>
[___t] =>
[__xtblog_rss] =>
[$v] => 3e1b05bd90fdcd10666b14db36b893c5
[$country] =>
[$forum] =>
[$function] => browser detail="4"
[$browser] => <img src="http://xtgem.com/images/browsers/mozilla.png" title="Mozilla" alt="Mozilla" />
[$included] => <b>This file has been included in to a variable</b>
[$widget] =>
[$w] => flickr_random_photo