Global Configuration Widget - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

This widget is required, as it defines the global configuration shared among all the widgets:

  • Coordinates of the AFS service where search requests are sent to
  • Language code used for localization of labels and messages.
  • Promote (ID of the replySet containing the ads)
  • Logging Level
  • Coordinates of the AFS Click Tracker web service

Configuration - Global Widget Configuration (target service, language, logging, ...).

Parameter

Type

Card

Default

Description

afsDefaults

Object

Optional

N/A

List of AFS parameters used by default. See afsDefaults Section.

logLevel

String

Optional

ERROR

The level of debugging information: DEBUG, INFO, ERROR

usePromote

Boolean

Optional

false

Set the parameter to true to use Promote. If only one feed is selected, Promote feed will always be added.

click

Object

Optional

N/A

See Click Section.

initFromSearch

Boolean

Optional

true

Some integrations do not require AFS Widgets to be initialized by an empty query. It is for instance the case when there is only a keyword widget that does not need anything from an AFS empty query. initFromSearch parameter can then be set to false.

Generally, such integrations do not display search replies in the same page and use the target parameter of the keyword widget.

This configuration allows to embed the keyword widget on any page of a website (and this widget will nerver query AFS). In this case, as soon as search is validated, a redirection is done to the target page with the right search parameter.

This option must be set to true to initialize widgets from an empty query or false to prevent them from executing any query.

afsPath

String

Optional

/

The prefix of the path URL fragment of the (AFS) web services. The full path of of AFS search, click, ACP, content is built by concatenating the content of afsPath resp. with "search", "click", "acp", "content".

defaultSort

String

Optional

N/A

The default sort criterion used for search requests.

pinsMode

String

Optional

NONE

Do the selected facets (aka. active filters) persist across searches or not.

virtualFields

Array

Optional

[]

Each array item is an object that describes a virtual search field.

It is composed of 3 required properties (name, placeholder, label):

  • name denotes the name of the virtual field.
  • placeholder is an explanatory text displayed in the input field when it is empty and does not have the focus.
  • label is a localized label for the field.

virtualField is mainly used by the Keywords widget and is stored here in order to be shared with the Context widget.

Example:

[
{"name": "bookTitle", "placeholder": "Enter a book title...", "label": "Book Title"},
{"name": "authorName", "placeholder": "Enter the name of an author", "label": "Author Name"}
].

errorCallback

String/Function

Optional

N/A

The name of a JavaScript callback that can handle runtime errors or an inline JavaScript function.

facetDescriptors

Array of Objects

Optional

[]

Extra descriptions of the specified facets. Each array item is an object composed of the properties: id, label, style, clusterizable that denote respectively the ID, title, CSS classes of a facet, and if clusters can be created over it. Default is an empty array.

See Facet Descriptors.

infiniteScroll

Boolean

Optional

false

Indicates if the new search results has to be appended to the existing ones or not (cf Pager widget).

xml

Object

Optional

N/A

useUrlHash

boolean

optional

true

Tells whether AFS Widgets can use the URL hash (URL part after the #) to store their status and thus support history navigation and search bookmarking.

URL hash is used by default and can be disabled for instance when AFS Widgets are integrated in a page that already uses the URL hash.

goToTopOnSearch

boolean

optional

true

Scroll to the top of the page when a new query is performed (using any widget, keyword, pager, and so on).

geo

Object

optional

N/A

baseUrl

String

Optional

""

Value to define equals to the <base> tag if used.

sort

Object

Optional

N/A

Definition of the sort criteria used by the Sort Widget. See dedicated paragraph.

cks

Object

Optional

N/A

Contains settings that apply to the CKS Widgets. See details in the dedicated paragraph.