The File List Pro plugin lists all of the files attached to the current post or page. It also allows you to embed multiple file lists in a page or post – these can be limited by file types or by a date range. Users can sort, filter, and search lists easily, making File List Pro perfect for download pages or Pdf newsletter lists.
To list files ready for download you just need to attach them to the current page/post in the normal way:
- Click the Add Media button.
- Use the drag and drop uploader, or manually upload your files.
- Click Save All Changes.
Adding a file list to your page
To add a File List to your page you just need to click the File List Pro button in the editor. This will let you pick the options you want to use for the list and add a shortcode to your page or post.
The following options are available for each list:
- File types to display – this lets you limit the types of file you want listed. For example a list of newsletters in pdf format can be created by choosing just the pdf option.
- Files per page – this is the number of files that should be shown before paging kicks in.
- Date range – this lets you limit the files shown in this list to only those uploaded between two dates. If you only want files before a cewrtain date, or after a certain date, just leave the other box empty.
- Open link in new window – this adds target=”blank” to the link and makes links open a new browser window when clicked.
- Hide search, Hide sort, Hide filter – these allow you to customise the display of individual lists by hiding pieces of functionality.
Once you have chosen all of your options click Insert File List and a shortcode will be entered into your content.
If you prefer you can enter the shortcode manually. Below is a shortcode with all possible attributes specified. When creating your own shortcode you can probably leave most of these out.
[prettyfilelist type=”pdf,xls,doc,ppt,zip” filesperpage=”10″ openinnew=”false” startdate=”2010-07-04″ enddate=”2014-08-15″ hidesearch=”false” hidesort=”false” hidefilter=”false”]
Options and Settings
Options for file lists can be set at a site level via the settings page. To access these settings go to Settings -> File List Pro.
The following options can be set:
- Style – File List Pro comes with 18 core styles ready to use. Select the style you want to use from the list and look at the preview to make sure it matches your site. When you’ve found ta style you like, click Save.
- Use a custom template – File List Pro is fully customisable, and can even use a custom layout for your lists. See the section title Using a Custom Template below for more details.
- Other options – These options let you hide or show the additionaly functionality on file lists. These options are site-wide and if set to hide WILL override options set on individual lists.
Creating your own style
You can create your own styles for File List Pro easily – the plugin has been designed so that future updates will not remove your styles.
Just create a /prettystyles/ folder in your active theme directory and copy one of the existing css files into it. This will then show in the File List Pro settings page with (custom) next to it. Make any changes you need to this file – most of the colours and core styles are at the bottom of the css files to make customisation easier.
Using a Custom Template
The look and feel of the links themselves can be further changed by creating a custom html template. To create a custom template make a copy of the pflprotemplate.php file in the /templates/ folder of the plugin, and copy it into the root of your active theme. Any changes you make to this file will now be reflected in all lists.
The template system works by replacing certain tags just before display. The following tags are all valid:
- ##src## – the url to the file.
- ##filetype## – the file type.
- ##additionalattr## – this is where additional options like target=”blank” get added in.
- ##size## – the file size (optional).
- ##date## – the date the file was uploaded (optional).
- ##title## – the title of the file (optional).
- ##esdc-count## – the number of times this file has been downloaded (this only works if you have Electric studio download counter plugin installed) (optional).
Template changes should only really be done by somebody who is comfortable with html/css, and knows how to fix it if it goes wrong.