Skip to content

Directory Options

Complete reference for the options object passed to .directory.init().

Top-level init keys

These are set on .directory.init(), not inside options:

KeyTypeDefaultDescription
selectorstring#haven-appDOM element to render into
formatstringlistDisplay format
categorystringnullLock to a single category nicename
dataarraynullPre-fetched product data
routingobjectsee RoutingURL routing configuration
optionsobject{}Feature options (below)

Layout

OptionTypeDefaultDescription
idstringhaven-listID of the generated list wrapper
sortstringnameSort field (name, etc.)
colsnumber1Grid columns
maxWidthnumber/string1280Max container width (px)
responsiveobjectnullBreakpoint → { cols } map
cssstring''Additional CSS class on container
titleTagstringh3Heading tag for list item titles
showCategoryTitlebooleantrueShow category title when active
categoryTitleTagstringh1Tag for category title
omitDetailsarray[]Detail fields to hide

Categories

OptionTypeDefaultDescription
categories.includearraynullCategory nicenames to include
categories.includePathbooleanfalseInclude category in URL path
categories.customarraynullCustom category configuration

Default category set when none specified: ACCOMM, FOODDRINK, ATTRACTION, SPORTREC.

OptionTypeDefaultDescription
breadcrumb.enabledbooleanfalseEnable breadcrumbs
breadcrumb.selectorstringnullExternal container selector
breadcrumb.rootLabelstringDirectoryRoot breadcrumb label
breadcrumb.showOnRootbooleanfalseShow breadcrumb on root view
breadcrumb.showProductInLightboxbooleantrueShow product name in lightbox
breadcrumb.includeRootWhenCategoryLockedbooleantrueShow root when category locked
breadcrumb.autoloadbooleanfalseAuto-load breadcrumb on init
breadcrumb.maxWidthstring''Max width override

Images

Each image type accepts imgix parameters:

javascript
images: {
  thumbnail: { ar: '3:2', w: 600, h: 400, fit: 'crop' },
  logo:      { ar: '3:2', w: 600, h: 400, fit: 'max' },
  featured:  { ar: '3:2', w: 1280, h: 400, fit: 'max' },
  banner:    { ar: '21:6', w: 1280, fit: 'crop' },
  gallery:   { ar: '16:9', w: 1280, fit: 'crop' },
}

Map

Enable with includeMap: true. See Maps and Lightbox for details.

OptionTypeDefaultDescription
map.autoloadbooleanfalseLoad map on init
map.geoLocateControlbooleanfalseShow geolocation button
map.mapAttachmentstringbeforebeginWhere to insert map in DOM
map.isClusteredbooleanfalseCluster markers
map.hideFilteredbooleanfalseHide filtered markers
map.mapBoxOptions.stylestringmapbox://styles/mapbox/light-v11Mapbox style URL
map.mapBoxOptions.zoomnumber10Initial zoom level
map.mapBoxOptions.centerarray[lng, lat]Initial map center
map.markerOptions.showLabelbooleanfalseShow marker labels
map.markerOptions.style.default.colorstring#00A4DBMarker color
map.markerOptions.style.default.hoverColorstring#8DC63FHover color
map.zoomOptions.targetnumber17Zoom level on item click
map.zoomOptions.popupsnumber15Zoom level for labels
map.zoomOptions.controlsbooleantrueShow zoom controls

Enable with includeLightbox: true.

OptionTypeDefaultDescription
lightbox.expandDirectionstringbottomPanel direction: top, bottom, left, right

Filter

OptionTypeDefaultDescription
filter.selectorstringrequiredExternal filter container
filter.maxWidthnumberinherits maxWidthFilter max width
filter.fieldsobject{}Field definitions (see Filters)

Favorites

OptionTypeDescription
favesobjectFavorites configuration (passed to HavenFaves)

Valid formats

list, itinerary, contactcard, category, detail, category-list, category-event

Haven Destinations integration documentation