Getting started with distributors-js


Requirements and dependencies

An active SSL certificate is the only requirement for using this library. If your website does not run under https set install an SSL certificate on your hosting. There are no dependencies that distributor-js requires, it’s vanilla JS with a few custom CSS classes and rules.

Installation

Embed the following <script> and empty <div> container on your website where you want to display the distributors.

Options

Set these data attributes on the empty <div> container in order to to customize the distributors layout.

NameTypeDefaultDescription
data-distributorsemptyRequired. In order to display the distributors add this standalone data attribute to the empty <div> container
data-brandstringemptyAll distributor brands will be loaded if this data attribute is either empty or not used.

Otherwise you can pass one of the following brand names:
Ilford
Polaroid
Peak Design
Samyang
General
Tamron
NiSi
Zhiyun
data-filterint0This data attribute only works in combination with the empty or not used data-brand attribute

I order to to display the brand filter dropdown set the value of this data attribute to 1. Leave data-attribute empty, set it to 0 or don’t use at all to prevent the brand filter dropdown from being displayed.
data-mapint0In order to display a map with distributors as markers set the value of this data attribute to 1. Leave data-attribute empty, set it to 0 or don’t use at all to prevent the map from being displayed.
data-api-keystringemptyOnly required in combination with data attribute data-map. Provide a valid Google Maps API key as a string in order to properly display the map with distributors as markers.

How to get a Google Maps API key?
data-colsint2This data attribute only works in combination with the data attribute data-map set to 1

In order to control the amount of the columns for the distributors listing set this data-attribute to either:
2
3
4

Examples

1. Default layout

Layout without additional settings. Will display the distributors of all brands in a 4 columns listing without filter or map

2. Layout with map

Layout with listing of the distributors on the left side and the map on the right side. The brand filter dropdown will be displayed above the listing. (In order to make the map appear bigger the data attribute data-cols could be set to 2)

3. Layout with distributors from a specific brand

With the data-brand data attribute it’s possible to control which distributors from which brand will be listed. Only one specific brand can be set.