Impart Media Region Gadget

The region gadget is the pivotal point for the gadget set. It is the largest and most option-heavy gadget of the set. A live example is shown below:

As with the previous gadget (search), the only required option is the vcID. The gadget on this page was started with this code:

<script src="//gadgets.impartmedia.com/gadgets.jsz" type="text/javascript"></script>
<script type="text/javascript">
    $w(function() {
        BE.gadget.region('#region-example',{
            vcID:85,
            itemDetailPageURL:'./03-details-and-cart-gadgets.html'
        });
    });
</script>

You can edit the above code and either: hit esc or click this paragraph to refresh the gadget...

There is also one special additional option, which must be implemented externally to, and before the region gadget initialisation. If you want to completely override the default syntax for the urls for the products, you must define a global variable called BE_gadgetURLOverrides. This is an object with the product id as the key, and the url as the key->value. Example syntax for this option is shown below.

var BE_gadgetURLOverrides = {
    10138: '/Best-Western-Crystal-Hotel.html',
    25480: '/Hotel-Shamrock.html',
    25481: '/Welcome-Stranger-Motel.html'
};

Region Gadget Defaults

If not supplied, these are the default values for the Region Gadget

accomOnlyMode:          false
advancedPriceView:      null
applyBoundsAlgorithm    true
campaignID:             null
collapseRefineTools:    true
customMapIcons:         null
defaultSort:            null
defaultRegionLoc        null
defaultRegionRegion     null
defaultRegionState      null
disabledTypes:          null
embedSearch:            true
enableRegionSearch:     false
forceAccomType:         null
forceTourType:          null
forceDefaultTypes:      null
forceMapBounds:         null
forceRegionLoc:         null
forceRegionRegion:      null
forceRegionState:       null
hideCategories:         null
ignoreSearchCookie: 	true
interactiveMapMode:     false
interactiveMapUser:     false
itemDetailPageURL:      '/product/detail.html'
lastMinuteMode:         null
limitLocations:         null
listAllMode:            false
noAdults                45 
noChildren              45
noInfants               45
noConcessions           45
noStudents              45
noObservers             45
noFamily                10
refineToolsLocation:    null
showAccomTypeFilter:    true
showAllAccom:           false
showAllLocationsForOperator false
showAllTours:           false
showAllEvents:          false
showLegend:             false
showList:               true
showLocationFilter:     true
showRoomDetails:        false
showMap:                true
showRefineTools:        true
specificTypes:          null
thumbsInGrid:           true
toursOnlyMode:          false
treatPrimaryTypeAsCategory false
vcID:                   null
vcLocations:            null
bookingStatus:          null

Each option is described below.


Note: in addition to its own options, the region gadget (if embedSearch is true) can be passed options from the search gadget to initialise state.


accomOnlyMode

Only show accommodatin operators on the gadget search.

advancedPriceView

If passed an empty array, this option will cause price view (for accommodation only) to render the list grouped according to accommodation type, with inserted headers. If you wish to specify a particular order of the type groups, you can insert strings into the array like so: ['Houses','Farmstay']. This will cause these two groups to be inserted first, with any remaining groups placed afterward.

applyBoundsAlgorithm

When interactiveMapMode is set to true, a bounds algorithm is applied. The purpose of this is to remove any strange lat longs from the list, to avoid strange icons being rendered. There may be a case where this algorithm may remove wanted icons. If this is the case try setting this option to false.

campaignID

This will put the gadget into campaign mode, and will only show operators that are part of the supplied campaign ID. In campaign mode, the sort order tool is hidden, as the sort order is defined at the campaign level. Should the campaign have used the levels functionality, then the gadget will add classes you can use to style the various levels.

The syntax for converting your level names to classes is: set to lowercase, replace spaces with hyphens and remove any numbers at the start of the name. So for example, 'First Class' would become 'first-class'. Note: your style declarations will need to use !important if you don't set rules any more specific than the ones already in use by the gadget.

collapseRefineTools

If set to false, this will cause the refine tools (filtering, sorting) to always be shown, rather than hideable.

customMapIcons

If supplied an object with the appropriate keys ['accom', 'tours','events','carhire','packages'] to match product types, you can override the default map markers with your own. See below for sample:

customMapIcons: {
    'accom':{
        icon:'the/URL/to/the/icon.png',
        pinpoint: [0,0],
        size: [0,0]
    }
}

Where the 'icon' value is a valid url to a png image for the marker. 'pinpoint' is an array of [x,y] which defines the point where you expect your marker to touch the map. 'size' is an array of [x,y] for the size of your supplied png.

defaultSort

Your preferred sort for the gadget when a user first loads the page. Accepts a string from the list: 'rating', 'price', 'name', 'location', 'instant', 'deal','lastminute'

defaultRegionLoc

When enableRegionSearch is set to true, you can set this parameter to default the location drop down to the option provided. NOTE: If the user makes a change the users selection will be used instead.

defaultRegionRegion

When enableRegionSearch is set to true, you can set this parameter to default the Region drop down to the option provided. NOTE: If the user makes a change the users selection will be used instead.

defaultRegionState

When enableRegionSearch is set to true, you can set this parameter to default the State drop down to the option provided. NOTE: If the user makes a change the users selection will be used instead.

disabledTypes

If using the embedSearch [true] option below, you can remove items from the product type drop down by setting this option to an array of any of these four strings: 'accom', 'tours','events','carhire','packages'.

embedSearch

If set to false, this allows you to place the search / refine tools functionality elsewhere in your layout, rather than being attached to the region gadget. You will need to initialise a search gadget before you start a region gadget with this set to false.

enableRegionSearch

Set to true to get the gadget to break down the location refine tools select list into state/region/location. Must have the showRefineTools option set to true.

forceAccomType

When showRefineTools is set to true this will default the Accommodation Types drop down to the string value specified.

forceTourType

When showRefineTools is set to true this will default the Tour Types drop down to the string value specified.

forceDefaultTypes

When working in interactiveMapMode, forceDefaultTypes will allow you to set the operator type ID (or ID's) to display by default when the interactive map is viewed. It is recommended this be used in conjunction with the specificTypes parameter. As a result, if an array of operator type ID's are passed it will locate the specificTypes that match and set those types to show by default.

forceMapBounds

When showMap or interactiveMapMode is true this parameter can force the viewport to display a defined boundary. This is done by specifying two lat/longs which define a rectangle. Once you set your bounds the Google API will automatically select the best zoom level to the bounds you've specified.

forceMapBounds: {
  pointA:{
      lat:-36.7858,
      lng:144.2261
  },
  pointB:{
      lat:-36.7395,
      lng:144.3157
  }
}				
			

forceRegionLoc

When enableRegionSearch is set to true this will set the location select list to the value supplied.

forceRegionRegion

When enableRegionSearch is set to true this will set the region select list to the value supplied.

forceRegionState

When enableRegionSearch is set to true this will set the state select list to the value supplied.

hideCategories

If supplied an array with any of the strings: 'accom', 'tours','events','carhire', 'packages' the interactive map mode will not show that primary category.

ignoreSearchCookie

When setting this parameter to true all search cookies will be ignored from other pages that have loaded the gadgets previously and provide new search results based off of the gadget settings.

interactiveMapMode

If set to true, this will force the gadget into interactive map mode, which shows only the map and a list of the primary (bookable) and secondary product types.

interactiveMapUser

When the interactive map searches Accommodation/tours/events/carhire/packages it runs a reservation request. When this is done it uses default values to run the request. When this mode is set to true the values pased to the search criteria will use the values that the user has currently used for searching.

itemDetailPageURL

This is a recommended option, like the previous search gadget, this sets the url for the next gadget in the chain - the item details gadget. This sets where the user goes when they choose a product from any of the views. It accepts and replaces the following tokens: '{name}','{url}','{type}','{id}'. The '{name}' token is the exact string of the product name, with all characters and punctuation. The '{url}' token is the product name, after the being set to lowercase, and having the following regular expression remove any non-valid characters: [^a-z0-9]. Spaces are then replaced with '-'. The '{type}' token is the internal type string: 'accom', 'tours','events','carhire','packages'. The '{id}' token is the product id, and can be used in conjunction with the '{type}' token to look up the product from the SJP.

lastMinuteMode

If set to true, this grid will only display operators who have enabled last minute discount rates in their Member Console.

limitLocations

Pass an array of location names to limit the gadget to only showing operators that match. This also affects the the location filter drop-down to only showing the supplied locations.

listAllMode

If set to true, it will force the gadget to list view, hide most of the controls and hide the price buttons.

noAdults

Maximum number of adults that can be selected from the drop adult drop down.

noChildren

Maximum number of adults that can be selected from the drop children drop down.

noInfants

Maximum number of adults that can be selected from the drop infants drop down.

noConcessions

Maximum number of adults that can be selected from the drop concessions drop down.

noStudents

Maximum number of adults that can be selected from the drop students drop down.

noObservers

Maximum number of adults that can be selected from the drop observers drop down.

noFamily

Maximum number of adults that can be selected from the drop family drop down.

refineToolsLocation

If you want to refine tools to be placed somewhere else in your page, pass a valid CSS selector as this option to have the gadget insert the refine tools into that element.

showAccomTypeFilter

If set to false, the gadget won't insert the accommodation type filter into the refine tools.

showAllAccom

If set to true, this will show all operators, even if they are unavailable for the time period searched.

showAllLocationsForOperator

When rendering out the price grid by default it will show the operators primary location. Setting this to true will show all their locations seperated by a / symbol.

showAllTours

If set to true, this will show all operators, even if they are unavailable for the time period searched.

showAllEvents

If set to true, this will show all operators, even if they are unavailable for the time period searched.

showLegend

If set to true, the gadget will create a small legend describing the different button colours. This will appear to the right of the view choice tabs, unless you're using advancedPriceView, then it will appear in the header row for each group. You can also pass an object to it to set the text for each button type:

{
    'instant':'Immediate booking', 
    'request':'24 hour booking'
}

showList

If set to false, the gadget won't show the tab for the details view.

showLocationFilter

If set to false, the gadget won't insert the location filter into the refine tools. Do not use this option when enableRegionSearch is set to true

showRoomDetails

If set to true, each operator will have the room name, max guests and room description displayed for the rate profiled in the search results. This is in addition to the Operator name and location that appears as standard. Please note that this parameter does not work in conjunction with the advancedPriceView parameter, as that parameter displays these extra room details by default.

showMap

If set to false, the gadget won't build or show the map view.

showRefineTools

If you want the user to be able to set up some preliminary filtering, set this to true. It is important to note that these fields be setup correctly inside the Bookeasy console otherwise this will fail to load

specificTypes

Used in conjunction with interactiveMapMode, if passed an array of type IDs (up to 12), it will output those specific secondary types in the map sidebar, in the order supplied. To look up types for a particular vcID, please refer to the SJP message getVcOperatorCategories.

thumbsInGrid

If set to false, the gadget will not insert thumbnails into the price grid.

toursOnlyMode

Only show tour operators on the gadget search. Can be set to true/false.

treatPrimaryTypeAsCategory

Used in conjunction with interactiveMapMode:true. When enabled the primary 4 types accom/tours/event/carhire will no longer be availability dependent.

vcID

REQUIRED. Set this to the appropriate visitor centre ID to fetch that area's data.

vcLocations

If passed and array of objects, the map will insert markers for the Visitor Centre data supplied. An example of the object format is as follows:

bookingStatus

OPTIONAL.This value is to set to "Booked" by default when a property is unavailable.But the user can still go head and change the text to any customised message as required using this option

vcLocations:[
    {
        name:'Hunter Valley Visitor Centre',
        lat:-32.781700,
        lng:151.344888,
        //Optional
		cusomImage: "{imageUrl}",
        customImageOptions: {
            size: { x: 300, y: 50 },
            origin: { x: 0, y: 0 },
            anchor: { x: 200, y: 0 }
        }        
    }
]
Home