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
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>»</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
Waplocus
Graham Not working...
I mean if path is "/Dev/index" let it print the "Dev"... Thanks
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
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
Graham
Waplocus Yes
which is why these days you are probably better off using @media queries
Waplocus
Graham will the mobile.css also be for the touch?.
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