Hi,
I would like to know how to get a number of documents in any given directory.
Is it possible to filter this number by category of document ?
Thank you in advance for any help.
Jacob
How to get a number of files in a directory ?
Re: How to get a number of files in a directory ?
Hey Jacob,
you can use a listview to count all Documents in a directory.
Like that:
If you just want to count files with searchable true, just change it. You can also add "contenttypes" for special kind of files or add "categoryids" for counting just one or more categorys.
Hope it helps!
Finn
you can use a listview to count all Documents in a directory.
Like that:
Code: Alles auswählen
<we:listview type="document" name="document_count" workspaceID="217" searchable="false">
<we:repeat>
<we:ifPosition position="last" type="listview"><we:position type="listview" format="1" /></we:ifPosition>
</we:repeat>
</we:listview>
Hope it helps!
Finn
Re: How to get a number of files in a directory ?
Thanks a lot !
I am still a beginner, using webEdition sporadically on rather basic level, but I am always amazed by the universality of this system.
A lot of things to discover !
Have a nice day !
Jacob
I am still a beginner, using webEdition sporadically on rather basic level, but I am always amazed by the universality of this system.
A lot of things to discover !
Have a nice day !
Jacob
Re: How to get a number of files in a directory ?
No need to start a we:repeat, imho
should work also.
And if you want to use the number in a variable:
Use we:ifFound to check, if there are any documents:
Code: Alles auswählen
<we:listview type="document" name="document_count" workspaceID="217" searchable="false">
<we:listviewRows />
</we:listview>
And if you want to use the number in a variable:
Code: Alles auswählen
<we:listview type="document" name="document_count" workspaceID="217" searchable="false">
<we:listviewRows to="global" nameto="found_items" />
</we:listview>
...
<we:var type="global" name="found_items" /> items found.
Code: Alles auswählen
<we:listview type="document" name="document_count" workspaceID="217" searchable="false">
<we:ifFound>
<we:listviewRows /> items found.
<we:else />
No items found.
</we:ifFound>
</we:listview>
Re: How to get a number of files in a directory ?
Thanks a lot, Thomas !
I appreciate a lot !
Jacob
I appreciate a lot !
Jacob
Wer ist online?
Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste