Assets are files that an HTTP web server can serve without backend/server processing. They are usually Javascript files, stylesheets (CSS), images, documents (PDF, doc), fonts, or media (audio, video) files.
This document details how assets are stored, managed, and accessed on Insites at the code level. Please visit the Assets documentation for Instances for a complete guide on managing and accessing assets using the Insites Admin.
The directory for assets is:
The directory for assets in a module is:
To correctly communicate with the Insites engine and API, you should organize your codebase into a specific directory structure. The root directory of your project should contain the
Although only the
Assets are uploaded to a Content Delivery Network (CDN). The CDN directory structure corresponds to the required directory structure of your codebase, except for the beginning of the URL.
Example
Location of the image asset in the codebase:
URL of the image asset on CDN:
URL of the image asset on your vanity domain with no CDN involved (it is slower, a CDN solution is recommended):
CDN host and Instance ID are dynamic and specific to your instance and region.
When you use the
The system will not add the
You can access assets using three different ways:
This method is usually used in CSS files to access fonts and images.
Example
Accessing an image in
The
Example
Accessing a JavaScript file located in
File has been found:
File does not exist:
Be careful not to use a leading
The
Example
File has been found:
File does not exist:
Be careful not to use a leading
Assets in modules are namespaced to not conflict with each other. They are also accessed by prefixing the path with the
Examples
File location:
Asset URL filter access:
Asset path filter access:
Currently, there is no way to remove assets/files from S3. If, for example, you only want one header image out of 6 to be present on the server, you should name the file the same while working on it — this way, the system will override it.
Please refer to the following links for related information on Assets:
Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.