Waplocus
Waplocus Slice Content
var $count=1
var $pos=0
@loop
var $pos=call strpos $haystack=$list; $needle=<!--*-->; $offset=($pos+1);
if $count<5
var $count=($count+1)
goto @loop
endif
var $l1=call substr $val=$list; $start=0 ; $length=$pos
var $l2=call substr $val=$list; $start=$pos
Copy code
Please i'm trying to xt include slice into the filelist, bt is not working.
Graham
Waplocus You cannot include xtscript into xtscript using xt include
to do that you need to use a xtscript include from a .xt file
it still has to be before you print the list and you are not using the same name for the list in the two scripts and $l1 and $l2 hold the two parts not $flist
You seem to be making it far more complicated than you need to
Waplocus
Graham k plz can u help me wit the steps?.
Graham
Waplocus It gets far too complicated as you have to start creating and calling functions
All you need to do is use the script I gave you with your own filelist
if you really want to print it from within the xtscript use
print $l1 <xt:include file="/file"> $l2
Waplocus
Graham Please graham the filielist is now okay. bt it is printin "
var =1" before the start of the filist.
Waplocus
Waplocus please i want to xt:include before the pagination. e.g
1
2
3
4
5
xt:include
6
7
8
9
10
xt:include
pagination(1,2,3...)
THANKS Graham.
Graham
Waplocus Same idea except the marker goes in your custom paging
add <!--p--> to the start of the paging container
http://baretest.xtgem.com/ntest
# Paging container
if $page == 1
print <!--p--><div class="custom_paging">
Then extend the main script
<!--parser:xtscript-->
var $list=<xt:filelist folder="/images" template="<a href=".file_url.?__xt_download=1">.file_name_base_parsed.</a><br /><!--*-->" per_page="10">
var $count=1
var $pos=0
@loop
var $pos=call strpos $haystack=$list; $needle=<!--*-->; $offset=($pos+1);
if $count<5
var $count=($count+1)
goto @loop
endif
var $l1=call substr $val=$list; $start=0 ; $length=$pos
var $l2=call substr $val=$list; $start=$pos
var $pos=call strpos $haystack=$l2; $needle=<!--p-->;
var $l3=call substr $val=$l2; $start=$pos
var $l2=call substr $val=$l2; $start=0 ; $length=$pos
<!--/parser:xtscript-->
<div>{_$$l1|}<xt:include file="/file" />{_$$l2|}<xt:include file="/file" />{_$$l3|}</div>
Copy code
Waplocus
Waplocus Wot about the below?.
xt:include
1
2
3
4
5
xt:include
6
7
8
9
10
xt:include
pagination(1,2,3...) THANKS Graham.