Web resources folder

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

See also