Funnelback logo

Documentation

CATEGORY

Web resources folder

Contents

Search forms often rely on external resources like Javascript or CSS files that must be served to the search user.

While those resources can be hosted in a separate server or in the public web folder of Funnelback (SEARCH_HOME/web/public/), you might want to store collection specific resources with the collection configuration. The Modern UI allows you to expose a special sub-folder of a profile to the search users.

To enable this feature a folder named web must be created under one of the profile folders of a collection, usually _default or _default_preview. For example: SEARCH_HOME/conf/collection/my-collection/_default/web/.

This folder will be exposed to the search user with the following URL: http://server/s/resources/ <collection>/ <profile>/ , e.g. : http://server/s/resources/my-collection/_default/. Any file placed in the web folder will be available using this URL:

SEARCH_HOME/conf/my-collection/_default/web/style.css -> http://server/s/resources/my-collection/_default/style.css
SEARCH_HOME/conf/my-collection/_default/web/js/jquery.js -> http://server/s/resources/my-collection/_default/js/jquery.js

Note that the special _default profile can be omitted in the URL:

SEARCH_HOME/conf/my-collection/_default/web/style.css -> http://server/s/resources/my-collection/_default/style.css
SEARCH_HOME/conf/my-collection/_default/web/style.css -> http://server/s/resources/my-collection/style.css 

To use these URLs in your search results form you can refer to the "resources" folder using a relative reference e.g.

src="resources/my-collection/style.css"

This reference will then be resolved relative to the URL of the page which contains it.

Caveats

  • This feature is unavailable with the Classic UI.
  • Funnelback v12.x now supports web-accessible sub-folders under the web/ directory.
  • Resource files must have an extension so that the Modern UI will know which mime-type to serve. For example a file named test.txt will work, but not if it's named simply test.

See also

top ⇑