Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-09-20 13:35:47

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

Count files belonging to filecategory/subcategory

Hello,
I need to show a message like ‘Sorry, no files available for the category 2013/blu-files’.
I can show the files list using <txp:file_download_list category='...' />, but when no file is available, there’s just a big white scary space. .. :)

Thanks for any suggestion

Last edited by Manaus (2013-09-20 13:36:05)

Offline

#2 2013-09-20 13:58:48

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: Count files belonging to filecategory/subcategory

For not counting but testing whether there is any file, have you considered a variable/if_variable test, like defining the variable by putting your file dl list tag inside it an then test for the emptiness of that variable?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2013-09-20 15:52:32

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Count files belonging to filecategory/subcategory

<txp:variable name="files"><txp:file_download_list /></txp:variable>

<txp:if_variable name="files" value="">
    <!-- No files available -->
<txp:else />
    <txp:variable name="files" />
</txp:if_variable>

Offline

Board footer

Powered by FluxBB