The Widget script
The attributes that you can find in the following settings list are all the attributes than you can define in the widget script. As written, there are all not mandatory : many of them are related to optional settings.
Here is an example of the widget script :
<script src="https://bridge-widget.v3.leadformance.com/release/<version>/bridge-widget.js"
data-target="#widget"
data-locale="en"
data-api-key="57f76cf6a4da070f00c58e73_f0a75daa-f4c5-4557-b25d-799270d3272"
data-api-secret="bc1d8180-5b82-4d75-bbc7-389d41aad3f3"
data-title="Welcome on the BRIDGE widget"
data-search-max-results="10"
data-search-placeholder="Search, ..."
data-search-radius="50000"
data-search-geolocation="true"
data-store-locator-url="https://merevo-luxury.v3.leadformance.com/"
data-custom-redirection-url="http://hmpg.net/"
data-map-provider="googleMap"
data-map-api-key="some map provider public api key"
data-map-marker="https://url/marker.png"
data-map-cluster="true"
data-custom-style-url="http://File.css">
</script>
Settings list
Here you can find all the available attributes:
Attribut (`data-`) |
Requis |
Type |
Description |
api-key |
true |
String |
This API Key is provided by the BRIDGE administrators. |
api-secret |
true |
String |
THE API Secret Key, also provided by the BRIDGE administrators. |
locale |
true |
String |
The locale used (en/fr). This will affect some labels and the results of the auto complete. |
target |
true |
String |
Your DOM element selector where you want to add the widget. It support the same selectors as `document.querySelector`. |
custom-redirection-url |
false |
String |
A custom url to redirect with the location id as a params (ex: http://your.url?locationId=). Hidden if no location id defined. |
custom-style-url |
false |
String |
The url of a custom CSS file that will override the widget style. |
search-geolocation |
false |
Boolean |
Set to "true" if you want to allow searching using HTML5 geolocation. |
map-api-key |
false |
String |
The map provider api key to use with the map (given by the map- provider) . |
map-cluster |
false |
Boolean |
Set to true if you want to activate cluster on the map. |
map-marker |
false |
String |
An url to a custom marker image to replace map provider default. |
map-provider |
false |
String |
The map provider amongst the authorized (for now : Google Maps). Don't add this attribute if you don't want to use a map. |
search-max-results |
false |
Number |
Define the number of maximum locations than can be returned in the widget results. |
search-placeholder |
false |
String |
A placeholder to display inside the search input. |
search-radius |
false |
Number |
The max radius of the search (in meters). |
store-locator-url |
false |
String |
The url of your store locator to redirect the user to (if existing). |
title |
false |
String |
A title to display on top of the widget. |
Comments
0 comments
Please sign in to leave a comment.