* Graham * Waplocus For css or javascript you could use
<link rel="stylesheet" href="/EXT/<xt:get_device_template />.css" />
Copy code
or for javascript
<script src="/EXT/<xt:get_device_template />.js" /></script>
Copy code

just use lowercase web.css mobile.js etc no xtscript required if you want the 'touch' option as well you will need to use the blog trick
2017-03-24 23:21 (edited 2017-03-24 23:26 by Graham ) · (0)
* Waplocus * Graham will the mobile.css also be for the touch?.
2017-05-17 15:50 · (0)
* Graham * Waplocus Yes
which is why these days you are probably better off using @media queries
2017-05-17 17:48 · (0)
* Waplocus * Graham Using the below code, how can i exit if the pathname is index and print the main path name
<!--parser:xtscript-->
var $spc=call chr $val=32
var $path=<xt:url type="path">
var $pos = call strrpos $haystack=$path; $needle=/
var $name = call substr $val=$path; $start=($pos+1)
var $name = call str_replace $subject=$name; $search=_ ; $replace=$spc 
print $name
<!--/parser:xtscript-->

Copy code
2017-11-02 14:43 (edited 2017-11-02 14:44 by Waplocus ) · (0)
* Graham * Waplocus
<!--parser:xtscript-->
var $spc=call chr $val=32
var $path=<xt:url type="path">
var $pos = call strrpos $haystack=$path; $needle=/
var $name = call substr $val=$path; $start=($pos+1)

var $isIndex = call stripos $haystack=*$name; $needle=index;
if $isIndex
var $newPath = call substr $val=$path; $start=0 ;$length=$pos
print $newpath
goto @end
endif

var $name = call str_replace $subject=$name; $search=_ ; $replace=$spc 
print $name

@end
<!--/parser:xtscript-->

Copy code
2017-11-03 11:18 (edited 2017-11-03 11:18 by Graham ) · (0)
* Waplocus * Graham Not working...
I mean if path is "/Dev/index" let it print the "Dev"... Thanks
2017-11-03 13:05 · (0)
* Graham * Waplocus couple of small changes
<!--parser:xtscript-->
var $spc=call chr $val=32
  var $path=<xt:url type="path" />
  var $pos = call strrpos $haystack=$path; $needle=/;$offset=1
var $name = call substr $val=$path; $start=($pos+1)

var $isIndex = call stripos $haystack=$path; $needle=index;
if $isIndex
var $newPath = call substr $val=$path; $start=1 ;$length=($pos-1)
print $newPath
goto @end
endif

var $name = call str_replace $subject=$name; $search=_ ; $replace=$spc 
print $name

@end
<!--/parser:xtscript-->

Copy code

demos
http://baretest.xtgem.com/tests/t2/index
and
http://baretest.xtgem.com/tests/t2/page
2017-11-03 13:45 · (0)
* Waplocus * Graham Thanks Sir.
2017-11-03 14:40 · (0)
* Waplocus * Waplocus
<!--parser:xtscript-->
/* INITIALIZE VARS */ 
var $linkId=1
var $path= <xt:url type="path" />/
var $offset=0
var $len=call strlen $val=$path
/* MAIN DIV*/
print <div class="RolWrap">
/* MAIN LOOP START*/
@loop
var $strt = call strpos $haystack=$path;$needle=/;$offset=$offset
var $end= call strpos $haystack=$path;$needle=/;$offset=($strt+1)
var $link=call substr $val=$path;$start=0;$length=$end
var $linktext=call substr $val=$path;$start=($strt+1);$length=($end-$strt-1)
/* EXIT IF INDEX FILE */
if $linktext == index 
goto @end
endif
/* LINKS */
if $strt >1
print <span>&raquo;</span>
endif
print <a href="$link" id="RolCont$linkId"> $linktext </a>
/* MAIN LOOP END */
var $offset=($strt+1)
var $linkId=($linkId+1)
if  $end < ($len-1)
goto @loop
endif
/* END */
@end
print </div>
<!--/parser:xtscript-->

Copy code
2017-11-03 17:22 (edited 2017-11-04 02:13 by Graham ) · (0)
* Waplocus * Waplocus Sir how can i implement the above script into the below page...the current page should have the "id="RolCont2"...
<div class="RolWrap"> »
 <a href="/Devices" id="RolCont1"> Devices </a>
 » <a href="/Devices/Java" id="RolCont2"> Java </a>
</div>

Copy code
.... Thanks
2017-11-03 18:07 · (0)

Online: Guests: 1