* Waplocus * Graham Hope it won't show the - in Search?.
2017-11-12 11:17 · (0)
* Waplocus * Waplocus i want to use the below code to list only the 1 file in the variable in the URL... Bt if no file is found, it list all my files and paginate it.. How can i stop it from only printing nothing?.
<xt:filelist sort_type="name" sort_dir="" folder="/Java/APPS/files/{_$File}" template=".file_name_parsed." per_page="1" />
2017-11-14 08:09 · (0)
* Graham * Waplocus for a start {_$File} should be in the 'filter' parameter not the 'folder' or it makes no sense
the best way would be to load the file list into a xtscript variable and then check it is empty and if it is empty then re set the variable using a full filelist without filter
something like
var $list= <xt:filelist sort_type="name" sort_dir="" folder="/Java/APPS/files/" template=".file_name_parsed." per_page="1" filter="{_$File}"/>
if not $list
var $list= <xt:filelist sort_type="name" sort_dir="" folder="/Java/APPS/files/" template=".file_name_parsed." />
endif

Copy code
2017-11-14 08:43 (edited 2017-11-14 08:44 by Graham ) · (0)
* Waplocus * Graham I'm printin a variable from a url in an xtscript, if variable was no found why don't return Not found as set in default instead of {_|Not Found}...is there any way?
2017-11-14 13:25 · (0)
* Graham * Waplocus The correct xtscript function is
get_or_default var_name;default_value
it gets the variable value from the query string or sets it to the default value if the variable is not in the url
you are not really meant to use {_$var|default} inside a xtscript although it does usually work
2017-11-14 15:59 (edited 2017-11-14 16:06 by Graham ) · (0)
* Waplocus * Graham ...
2017-11-17 06:24 (edited 2017-11-17 06:25 by Waplocus ) · (0)
* Waplocus * Graham ....
2017-11-17 06:24 (edited 2017-11-17 06:30 by Waplocus ) · (0)
* Waplocus * Graham ...
2017-11-17 06:24 (edited 2017-11-17 06:32 by Waplocus ) · (0)
* Waplocus * Graham Please how can i print the first path name of a path...
e.g in /a/b/c/d/e/f/.... to print a.
Thanks.
2017-11-17 06:24 · (0)
* Waplocus * Waplocus and Please also how can i print the second path name of a path... e.g in /a/b/c/d/e/f/.... to print b. Thanks.
2017-11-17 06:44 · (0)

Online: Guests: 1