Skip to content

Web resources

Linked external resources

Most templates often rely on external resources such as image, JavaScript and CSS files.

These external resources can be stored at any web-accessible location such as your public web server and referenced as external resources from the template using absolute URLs.

Funnelback also provides web resource folders that can be used for local storage of these files. Web resource folders are associated with the folders that contain the search template files.

The URL of a web resources folder is constructed using the following pattern: PROTOCOL://FUNNELBACK SERVER NAME/s/resources/COLLECTION/PROFILE/FILENAME

where:

  • PROTOCOL is either http or https
  • FUNNELBACK SERVER NAME is the hostname of the Funnelback server. If referencing from a template the FUNNELBACK SERVER NAME and protocol can be omitted and presented as a relative link.
  • COLLECTION is the collection containing the resource. (This can be copied from the collection parameter in the URL of the file manager). When accessing a resource from within a search template COLLECTION should be replaced with ${question.collection.id}
  • *PROFILE is the profile containing the resource (this can be copied from the profile parameter in the URL of the file manager). When accessing a resource from within a search template PROFILE should be replaced with ${question.profile}
  • FILENAME is the filename of the web resource.

This corresponds to a local folder on disk: SEARCH_HOME/conf/<collection>/<profile>/web which is created at the same time as the profile.

E.g. a link to a resource from a template styles.css might be:

<link rel="stylesheet" href="/s/resources/${question.collection.id}/${question.profile}/styles.css" />

Caveats

  • Sub-folders (e.g. web/js or web/css) can be manually created beneath the web folder, but this requires back-end access, and the sub-folders are not exposed in the administration interface.
  • Resource files must have an extension so that an appropriate mime-type is returned with the file. For example, a file named test.txt will work, but not if it's named simply test.

See also

top

Funnelback logo
v15.16.0