Language:


File Management

This page describes the following Structure Types:
  • File

  • Folder
And the following Element Types:
  • Image

  • Link
All the settings and registers mentioned on this page are located in the Webshop and CMS module unless otherwise specified.

---

File Storage

You can store the images, stylesheets and other files that will be used by your website in the following places:
  1. In a folder named "webcust" that is located on the server in the folder containing your Standard ERP application. You can use sub-folders inside the "webcust" folder.

  2. You can add records to the Structure register in which the Type is "Folder" and attach the files that you need to these records. You can also attach Notes containing stylesheet information or JavaScript code to these Structure records.

Webcust Folder

Use conventional <img src>, <link> and <script> tags to link to files that are stored in the "webcust" folder. You can use a relative path, for example:
<link href="/styles/styles.css" type="text/css" rel="stylesheet">
refers to a stylesheet file that is named "styles.css" and that is located in a folder named "styles" that is inside the "webcust" folder. The initial / is optional: you can use styles/styles.css or /styles/styles.css.

You can also link to files in the "webcust" folder using "Image" and "Link" Elements. An "Image" Element will display an image, while a "Link" Element will display a link to an image.

In an "Image" Element, enter the path to the file in the Parameter/URL field:

In a "Link" Element, enter the path to the file in the Parameter/URL, and add a Translation or Translations that will contain the link text and/or image:

You must enter at least one Translation, otherwise the link will not be displayed in the browser.

In the example illustrated below, we have placed the "Link" Element from the previous illustration on a page displaying information about Product 20101:

"Folder" Structure Record

To use a "Folder" Structure record, follow these steps:
  1. Add a record to the Structure register in which the Type is "Folder":

  2. Attach images, stylesheets and other files to the record from step 1:

  3. To refer to a file that you have attached to a "Folder" Structure record, use the following syntax:

    /Web_structure_name?file=filename

    For example, to refer to an image named logo.jpg that is attached to the "Folder" Structure record from step 1:

    <img src="/files?file=logo.jpg">

    And to use a stylesheet file that is attached to the "Folder" Structure record from step 1:

    <link href="/files?file=styles.css" type="text/css" rel="stylesheet">

    Use the same syntax in any field that can refer to a file that might be attached to a "Folder" Structure record, such as the Parameter/URL field in "Image" and "Link" Elements. The example illustrated below shows the Stylesheet field in the Sites setting:

    Similarly, to refer to a JavaScript file that is attached to the "Folder" Structure record from step 1:

    <script src="/files?file=javascript.js" type="text/javascript"<>/script>

  4. As well as attaching stylesheet and JavaScript files to a "Folder" Structure record, you can also copy the contents of those files to Notes that are attached to the "Folder" Structure record. This may be useful if you would like to be able to edit stylesheet and JavaScript files and have the changes become active immediately, without needing to download, edit and then upload files:

    Assign a unique Comment to each Note, because you will use the Comment when you need to refer to a Note, as follows:

    /Web_structure_name?file=Note_Comment

    For example:

    <link href=/files?file=stylesheet.css" type="text/css" rel="stylesheet">

  5. As elsewhere in the website, you can build up a hierarchical structure of "Folder" Structure records using the Parent field:

    Include both the parent node and the sub-node when referring to attachments and Notes:

    /Parent_Web_structure_name/Sub_Web_structure_name?file=filename

File Downloads

If you need browser users to be able to download files, you can make those files available using the following methods:
  • You can use conventional <a href a> tags with download attribute to link to files that are stored in the "webcust" folder. For example:

    <a href="/manual.pdf" download>Download the manual</a>

  • You can use a "File" Structure record.
To use a "File" Structure record, follow these steps:
  1. Add a record to the Structure register in which the Type is "File":

  2. Attach the file that users will be able to download to the record from step 1:

    Note that the file name should not include any spaces.

  3. To make the file available for downloading, use the following syntax:

    /Web_structure_name

    For example, to refer to a file that is attached to the "File" Structure record from step 1:

    <a href="/downloadmanual"> Download the manual</a>
---

Go back to: