CFiles Documentation - Themes

CFiles themes give you full control over the appearance of your download library. They have been designed with simplicity and ease of editing in mind. By editing just 3 files, you can almost totally change every aspect of the generated page. What's more, the generated CFiles pages can include Javascript, Java or any other element or plugin type you like. This means if you want to offer a certain type of file, you can tailor the output specifically for that type of file. CFiles comes equipped with a default theme containing all available tags.
 
 Themes

Themes are a big part of CFiles. By default, CFiles comes with the "carrick" theme which can be located in a directory called "carrick" within the themes directory. A theme is comprised of a whole bunch of .tmpl files. These files are plain HTML, with special tags throughout them where data will be substituted. They can be edited using either a text editor, or many HTML editors will show them correctly.

CFiles works using 3 main files:
header.tmpl
main.tmpl
footer.tmpl

These 3 files contain the majority of the page design. Of the other files, "row_" prefix indicates a table row which will be reused to produce lists like the stats, category lists, and file lists. "page_" indicates a page of data which will be inserted into main.tmpl to produce a finished page. "form_" indicates a page of form data which will be inserted into main.tmpl to produce a finished page. Basically the same as "page_" in operation, but named differently to enable distinction between template types.

While CFiles generates data, and sometimes AHREF tags, all design options have been left in the templates. So you can edit the HTML in these templates and it won't break the script. BE AWARE, if you encounter html forms in a page that you are editing, you should faithfully reproduce all the special tags in the inputs. This is not important for non-form data. ie. You can drop one of the statboxs from the main page simply by deleting it's tag in main.tmpl. However you can't remove form fields in the same way.

To make a new theme, you must reproduce every file in the carrick directory, however for an easier way, you can just edit header.tmpl,main.tmpl and footer.tmpl, and copy the rest of the templates across and it will still work fine.

If you create a new theme, you are invited to send it to us for download from the main CFiles site. The Copyright and "Powered by CFiles" label must remain intact somewhere on each page, but you can alter the "Theme Design By" line to your own name and link. This could provide your organisation with a wide web presence if your theme is a popular one.

 
 Back to index