Accessing web resources from Freemarker

Background

External resources such as Javascript, CSS and image files are often required for Funnelback’s search results.

These resources are normally stored within a CMS and referenced as external links from within the Funnelback search results template. However it is sometimes desirable to host some or all of the files on the Funnelback server.

This article shows how these resources can be added to Funnelback and how to reference them from a search results template.

This article applies to Funnelback 12.2 - 15.18. In Funnelback 15.20 and newer web resources can be managed via the administration interface or by WebDAV - see Funnelback documentation - web resources

Adding web resources to Funnelback

The Modern UI allows CSS/JS/images to be uploaded via the administration interface to a web resources folder.

To do this requires access to the Funnelback administration interface.

  • Log in to the administration interface - the address will be similar to https://<FUNNELBACK-SERVER>:8443/search/admin/

  • Change to the collection and profile that needs to host the files.

  • Select browse collection configuration files from the administer tab.

  • In the file display that loads locate a section labelled web resources (preview) for the profile. Use the upload control within this section to upload the files.

  • Once the files are uploaded then need to be published before they can be accessed.

Access web resources from Freemarker

Once uploaded and published items within this web folder can be accessed from templates using the following web path.e.g. to access a file called filename.jpg from the web resources folder use the following link:

<a href="/s/resources/${question.collection.id}/${question.profile"}/filename.jpg" />

Further reading

Funnelback documentation: Web resources folder