/
CMS_FILELIST

CMS_FILELIST

Content type CMS_FILELIST provides selection and configuration of files in CONTENIDO backend and output files with preview in frontend of the page.

To use CMS_FILELIST put the code below in your output modul section.

The name CMS_FILELIST specifies which content type should be used and [1] is the index of headline. The index must be integer value.

Note

If you are using more then one CMS_FILELIST per article, you have to change/increment index of the next CMS_FILELIST .

echo "CMS_FILELIST[1]";
or
echo "CMS_FILELIST[100]";

1. Configuration

The configuration of CMS_FILELIST is splitted in four different sections.

To configure filelist click on the blue filelist icon(see screenshot below).

In the first tab Directories you can select one or multiple directories from the upload folder.

After selection you can save selection by clicking on green checkbox or cancel selection by clicking on red cross icon.

In the second tab General you can set all content type general settings.

  • file list title: here you can input title of your file list.
  • file list style here you can define style of your filelist. By default you have default style, which is defined in cms_filelist_style_default.html template in templates folder.
    Of course it is possible to define own templates. you can do it by client setting. The setting you have to set looks like: type -> cms_filelist_style. name -> some name, this name displayed in configuration drop down, value -> is the name of new template, it must begin with cms_filelist_style prefix, the rest can free defined.
    Example: cms_filelist_style_mynewdefaultstyle.html could be a valid name.
    After creation of client setting you have to create and fill new template in style -> html with the name.
  • file list sort: in this setting you can set given sort criteria.
  • sort order: you can define here sord order ascending or descending.
  • include subdirectories: check this option if you want include subdirectories with the files.
  • include metadata: check this option if you want include file meta data.

In the third tab Filter you can define different filters.

  • filter settings: by unchecking of select all entries you can exclude some file types like gif, jpg etc. To exclude more then one file type press and hold control button.
  • file size limit: you can filter here by file size in megabytes. Files between this size won't be not excludet.
  • creation date limit: you can filter here by creation date. Files which are created between given date, won't be excludet.
  • modify date limit: you can filter here by modify date. Files which are modified between given date, won't be excludet.
  • file count: here you can filter by file count.

In the last tab Manual you can manually define files. To use this setting you have to check use manual file list. After that you will see configuration area.

Configuration area consists of two parts. Existing files and add file. To add file select directory with a click and then choose file which is placed in this directory.

After selection click on blue plus icon. The file will be added to the existing files. To finish configuration click on green check icon or cancel by clicking on red cross icon.

2. Filelist template

Teaser templates are high customisable. To view teaser templates  go to style -> html.

The name of teaser templates begins with cms_filelist_style and contains html markup with cTemplate placeholdern, which are filled by content type(see example below).

<h2 class="download_list">{TITLE}</h2>
<ul class="download_list">
    <!-- BEGIN:BLOCK -->
    <li>
        <img src="{FILETHUMB}" />
        <div class="content">
            <p>
                {FILEMETA_DESCRIPTION}
            </p>
            <span class="info">{FILEMETA_COPYRIGHT}</span>
            <ul class="formats">
                <li>
                    <a href="{FILELINK}" >{FILEEXTENSION} ({FILESIZE})</a>
                </li>
            </ul>
        </div>
        <div class="clear"></div>
    </li>
    <!-- END:BLOCK -->
</ul>
<div class="clear"></div>

The code between <!-- BEGIN:BLOCK --> and <!-- END:BLOCK --> will be executed more then once. It depends how much file entries you have.

Possible placeholder which you can use are:

  • {TITLE}
  • {FILEMETA_DESCRIPTION}
  • {FILEMETA_MEDIANAME}
  • {FILEMETA_KEYWORDS}
  • {FILEMETA_INTERNAL_NOTICE}
  • {FILEMETA_COPYRIGHT}
  • {FILETHUMB}
  • {FILENAME}
  • {FILESIZE}
  • {FILEEXTENSION}
  • {FILECREATIONDATE}
  • {FILEMODIFYDATE}
  • {FILEDIRECTORY}
  • {FILELINK}

Methods for CMS_FILELIST

List all methods for CMS_FILELIST at our API documentation.

Function nameDescription
generateViewCode()Generates the code which should be shown if this content type is shown in the frontend.
generateFileListCode()Function is called in edit- and viewmode in order to generate code for output.
generateEditCode()Generates the code which should be shown if this content type is edited.
generateFileSelect()Generate a select box containing all files for the manual tab.