Skip to content

FileLink

Using fileLink, a file can be linked to the record. The file can be retrieved via a URL or a node reference indicating the node that contains the file data. The deposited files can also be downloaded or shown on the records list item.

URL

"root": {
    "fileLink": {
        "url": "insight/document/insight/${identifier}",
        "fileName": "${filename}",
        "download": true,
        "showInList": true,
        "existsAttribute": "identifier"
    }
}
  • url: to retrieve the file.
  • fileName: to store the file with a correct filename. This property is optional and only must be set if the url does not contain a file name with extension.
  • download: Boolean, to download the files when the common download is performed. (Download configuration) The max file count per config is 100 files. The defalut value can be overridden in the Client-Configuration.
  • showInList: Optional value which if set to true will show the file in the list and search results. If not set file is not shown.
  • existsAttribute: Optional attribute which defines if the image exists and is therefore shown on the list. If not set file is always shown.

NodeReference

"root": {
    "fileLink": {
        "data": {
            "nodeReference": "${targetNode}"
        },
        "showInList": true,
        "existsAttribute": "IMGLIBID"
    }
}
  • nodeReference: to provide the node name containing the file data. This can be used for building the path to the file (e.g. to build the path to a thumbnail image).

List Preview

If showInList is set to true the image is shown in the root list, child list and search results. The existsAttribute can be used to define an attribute which defines if the image is shown. If the value of the attribute is undefined, null, 0 or an empty string the image is not shown.

Style

A list item can contain a thumbnail image. To change the default style of the image, the following classes can be used:

  • item-image on the list item when it has an image. This class is also set when the existsAttribute returns false.
  • item-image-placeholder on the placeholder image which is shown while the image is loading or no image exists.
  • item-with-image on the content of the item having a loaded image. To align the content next to the image.
.item-image {
    position: var(--list-image-position);
    left: var(--list-image-left);
    height: var(--list-image-height);
    width: var(--list-image-width);
    object-fit: var(--list-image-object-fit);
}

.item-image-placeholder {
    opacity: var(--list-image-placeholder-opacity);
    display: var(--list-image-placeholder-display);
    justify-content: var(--list-image-placeholder-justify-content);
    align-items: var(--list-image-placeholder-align-items);
    font-size: var(--list-image-placeholder-font-size);
    width: var(--list-image-width);
}

.item-with-image {
    padding-left: calc(var(--list-image-width) + 9px) !important;
}

The variables are explained here.