* Graham * kapilover08 if you have a very large folder it is best to keep the actual filelist out of xtscript due to timeouts
bog standard simple search using the filter
searches for filenames that start with the query
<!--parser:xtscript-->
# Search form
get search
print {{<div>
<form action="<xt:url>" >
<input type="search" name="search" value="$search" />
<input type="submit" value="go" />
</form>
</div>}}
<!--/parser:xtscript-->
<xt:filelist folder="/files" template="" per_page="10" filter="{_$search|}*" />

Copy code

if you want NO output without a search then change the filter to {_$search|-}*
The form does really have to be xtscript either
<div>
<form action="<xt:url>" >
<input type="search" name="search" value="{_$search|}" />
<input type="submit" value="go" />
</form>
</div>
<xt:filelist folder="/files" template="" per_page="10" filter="{_$search|}*" />

Copy code

works just the same
2015-03-10 11:09 (edited 2015-03-10 11:46 by Graham ) · (0)

Online: Guests: 1