JS File
A JS File asset is used to upload JS files into Squiz Matrix. To allow users to view and download the file from your Site, you need to create a JS File asset. Once it has been created, it can be used as many times as you like within your Squiz Matrix system.
Bookmarks to the headings on this page:
Adding a JS File
When you add a newJS File, additional fields appear on the Create new JS File screen, as show in the figure below.

The fields available on the Create new JS File screen
Enter the following details for the JS File asset:
- Title: enter the name for the JS File asset. This will be used as the friendly name of the JS File and will appear in the Asset Map. This name will also appear when the Keyword Replacement%asset_short_name% is used. This field is required when creating a JS File.
- Upload File: select which file to use as the JS File. To do this, click on the Browse button - the File Upload pop-up will appear. Locate the file that you want to use, left click on it and click on the Open button. The path of the file that you have selected will appear in the Upload File field. You can only upload files of type css.
- Choose a pre-uploaded file:if the file has already been uploaded to the server, you can select that file by clicking on the Choose a pre-uploaded file button. For more information on how to do this, refer to the Using Pre-uploaded Files section in this chapter.
Once you have entered the required information, click Commit. Your JS File will appear in the Asset Map on the left hand side of the screen.
Once created, you can configure the settings of your JS File on its associated asset screens. These screens are often the same or similar to those for a Standard Page and are described in the Asset Screens manual. In this chapter, we will describe the Details and Edit Contents screens, which are different for a JS File.
Tip: To find out which assets in the system have a hyperlink to a JS File, look at the Linking screen. The assets linked to the JS File will be listed in the Current Linking section.
Details Screen
The Details screen for a JS File allows you to set up this asset. For more information about the Status, Future Status and Thumbnail sections of this screen, refer to the Details chapter in the Asset Screens manual.
Details
This section allows you to change various details of the JS File including the Title and which file to use.

The Details section of the Details screen
The fields available are as follows:
- Title: by default, the Title that was entered into the Title field when the JS File was created will appear in this field. You can change the Title by clicking into this field and entering the new Title for the JS File.
- Filename: by default, the name of the file that was used when the JS File was created will appear in this field. You can change the name of the file by clicking into this field and entering the new file name.
- Upload File: this field allows you to upload a new version of the JS File. This file can be an updated version of the file or a different file. To upload a new file, click on the Browse button - the File Upload pop-up will appear. Locate the file that you want to use, left click on it and click on the Open button. The path of the file that you have selected will appear in the Upload File field.
-
Current File: this section outlines the details of the JS File including the size of the file and when it was last updated. If you click on the Current File link, a preview of the file will appear in a new window.
Tip: If you have selected a new JS File to upload using the Upload File field, the details of this file will not appear in the Current File section until you click Commit.
-
Allow Unrestricted Access: depending on what this setting is, the Status of the JS File and whether or not Public Read access has been granted, Squiz Matrix will use different style URLs.
-
Yes: if the Status of the JS File is Under Construction and Public Read access has been granted then a human readable URL will be used, for example, http://www.example.com/word.doc. This means that it is served dynamically from the Squiz Matrix repository and hence is not optimal in terms of performance.
If the Status of the JS File is Live and Public Read access has been granted then a static URL will be used, for example http://www.example.com/__data/assets/image/100/word.doc where 100 is the asset ID of the JS File. The static URL gives optimal performance as it is served directly by the web server. - No: if this setting is No, then the human readable URL will be used. This may be required if an external system is referencing the file and needs to use the dynamic human readable URL.
-
Yes: if the Status of the JS File is Under Construction and Public Read access has been granted then a human readable URL will be used, for example, http://www.example.com/word.doc. This means that it is served dynamically from the Squiz Matrix repository and hence is not optimal in terms of performance.
Edit File Screen
By default, the content of the file that was uploaded when the JS File was created will appear in the Edit File section of the Edit File screen, as shown in the figure below.

The Edit File section of the Edit File screen
You can change the content by clicking into this field and entering the new content for the JS File.
Using Pre-uploaded Files
When creating anew JS File, on the Create new JS File screen there is an option called Choose a pre-uploaded file. This option allows you to select a file that has already been uploaded to the Squiz Matrix server. For more information on how to upload a file to the server, refer to the Server Administrator manual.
When you click on the Choose a pre-uploaded file button, the fields shown in the figure below will appear on the Create new JS File screen.

The Create JS File screen when using a pre-uploaded file
The fields available are as follows:
- Title: enter the name for the JS File asset. This will be used as the friendly name of the JS File and will appear in the Asset Map. This name will also appear where ever the keyword replacement %asset_short_name% is used. This field is required when creating a JS File.
- Choose a pre-uploaded file: select which file to use from the list provided. This field is required when creating a JS File.
- Upload File: if the file has not been uploaded to the server, click on the Upload a new file button to upload the file manually. For more information on how to do this, refer to the Adding a JS File section in this chapter.
Updating the JS File
Once a JS File has been created, you can change the file that it is using at any time. To do this, go to the Details screen of the JS File. In the Upload File field, click on the Browse button - the File Upload pop-up will appear. Locate the file that you want to use, left click on it and click on the Open button. The path of the file that you have selected will appear in the Upload File field. You can only upload files of type css.
Once you have clicked Commit, any assets that reference the JS File will be updated with the new version of the file.