AddBookmark - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.9
Category
Reference Guide

This widget requires a user to be logged, otherwise it does not display anything (see CKS Widgets). It allows a result seen on its product page to be bookmarked. (Also see AddBookmark Component)

Parameter

Type

Card

Default

Description

nameBuilder

String/Function

Optional

(Window title)

Name of an existing function or function that can be called to compute the name of the bookmark. See details below.

descriptionBuilder

String/Function

Optional

""

Name of an existing function or function that can be called to compute the description of the bookmark. See details below.

urlBuilder

String/Function

Optional

(Current page URL)

Name of an existing function or function that can be called to compute the result URL. See details below.

outsideClickTogglePanel

Boolean

Optional

false

Indicates if the click has to be monitored to change the widget state. See tip below.

This widget is made to be installed on a product page. Information used to create the bookmark (name, description and URL) cannot be precisely guessed from the integration page. Three functions can be defined to adjust this behavior. For example, using a JavaScript-based configuration, this can be done like below:

var AFSWidgetAddBookmark = {
urlBuilder: function() {
return window.location.href; // default implementation
},
nameBuilder: function() {
// return document.title; // default implementation
return document.getElementById('product-title').textContent;
},
descriptionBuilder: function() {
return document.getElementById('product-description').textContent;
}
};