CMS help pages
  
You are here: Home > Files > Referencing files from HTML

Referencing files from HTML

If your website has the HTML section template or has editable HTML in the layout, you can reference files directly from your HTML by prefixing your file name with "files/".

Example

Let's assume we uploaded a file called "myimage.jpg" using the "Files" tab.

Your HTML to display this image would be:

.. <img src="files/myimage.jpg" width="...

Publishing

When you publish your website a copy of your file will be published along with your website.

If you need files to be transferred to the web server, but these files are not referenced in the HTML, you will need to put a reference in a comment somewhere in the HTML to ensure that the CMS knows that these files should be published. Put quotes around the file reference.

e.g.

<!--
"files/myfilea.js"
"files/myfileb.js"
"files/myfilec.js"
-->

Note: Case is important! To avoid problems when publishing to Unix servers or where files are referenced from Java etc, the original caes is preserved when the file is published. The case in your HTML must match the case of the filename, if not, you will get an error on publishing "the directly referenced file xxx cannot be found".