CabGrid Pro supports shortcode attributes that can adjust the appearance and functionality of each individual instance of CabGrid on your website. This article discusses the available shortcode attributes and how to implement them.

Note, CabGrid can also be added to a page as a widget or a Gutenberg block. Each provides its own user interface to assign attribute values. However, the definitions below still apply.

Table Shortcode

In addition to the standard price calculator, CabGrid Pro also provides a table layout shortcode:
[cabGridProTable]

This can be configured with its own attributes. These are detailed in a separate article.

Shortcode Attribute Syntax

The syntax for attributes is (use double quotes around values):
[cabGridPro attr1="val1" attr2="val2"]

When using the WordPress Classic Editor (aka TinyMCE) to edit posts or pages, the Cab Grid icon (Insert Cab Grid icon) will insert the Cab Grid Pro shortcode with all available attributes and some default values. Otherwise, attributes can be added as required.

Current Cab Grid Pro Shortcode Attributes

Click on an attribute title to get details and example values…

ID
The “id” attribute is used to uniquely identify an instance of Cab Grid Pro. This can then be used to target specific styling to an instance via CSS.

SYNTAX: [cabGridPro id="MyInstance5"]

The ID attribute of the main Cab Grid Pro element will be prefixed with ‘cabGridPro‘ so, for example, it could be addressed in CSS like this: #cabGridProMyInstance5 {background-color:red;}

In Cab Grid Pro v4 or earlier, the ID attribute also provided GROUP functionality (see GROUPS tab for more info).

GROUPS
From Cab Grid Pro v5, the “groups” attribute is used to limit the places (or areas) available by group or groups as defined under the AREAS tab on the Cab Grid Pro admin page.

v5 SYNTAX: [cabGridPro groups="group1,group2"]

In Cab Grid Pro v4 and earlier this functionality was provided via the ID attribute.

v4 SYNTAX: [cabGridPro id="group1,group2"]

More info about groups here…

LAYOUT
The ‘layout‘ attribute is used to set which layout (or calculation model) is used for this particular instance of the Cab Grid Pro plugin.

If it is not set, the default layout will be used – as set in the OPTIONS tab of the Cab Grid Pro WordPress admin.

The layout attribute can currently be set to ‘passengers‘ or ‘vehicle‘ or ‘tickets‘ or ‘time

When set to ‘passengers‘ the Cab Grid interface will show input boxes for the number of passengers and number of luggage items, and use this information to calculate which vehicle is most appropriate and select a price.

When set to ‘vehicle‘ the Cab Grid interface will display details of all vehicles configured. The user will need to choose a vehicle as well as setting origin and destination to obtain a journey price.

When set to ‘tickets‘ the Cab Grid interface will show a single number input. This is for the number of tickets required. This is good for municipal transport such as bus, coach or train services. The number of tickets specified will multiply the price for the journey. So 2 tickets for a £10 journey will result in a price of £20.00 being displayed. (The number of tickets will govern which vehicle is selected – and hence price table.)

When set to ‘time‘ the Cab Grid interface will show a number input. This is for the number of time units required. The unit of time can be set in the OPTIONS tab when ‘Length of time‘ is selected for the ‘Price Based On’ option. This is good for tour or hire style businesses. The time period specified will multiply the price for the journey. So 2 units (hours, days, or whatever set) for a £10 journey will result in a price of £20.00 being displayed.

In ‘time‘ mode, the number of passengers field will also be displayed (though it is possible to hide this field through CSS). This is used to govern which vehicle is selected – and hence price table. The return button is also hidden in time mode as it is not relevant (though it may be re-enabled through CSS). The time option was introduced in Cab Grid Pro version 4.5.

SYNTAX: [cabGridPro layout="passengers"] or [cabGridPro layout="vehicle"]or[cabGridPro layout="tickets"]or[cabGridPro layout="time"]

ICONS
This shortcode attribute was added in Cab Grid Pro version 3.0.

The ‘icons‘ attribute is used to set the general icon set and text colours the instance uses.

Currently, values can be set to ‘light’ or ‘dark’. Light icons (& text) are for instances with dark backgrounds and vice versa.

SYNTAX: [cabGridPro icons="light"]

LUGGAGE
This shortcode attribute was added in Cab Grid Pro version 3.0.

The ‘luggage‘ attribute is used to set if the luggage input field is hidden.

It expects values of either ‘Off’ (with capital ‘O’) to hide the input field, or ‘On’ (with upper-case ‘O’) to explicitly show the input field*.

SYNTAX: [cabGridPro luggage="Off"]
OR [cabGridPro luggage="On"]

*The ‘On’ setting has only been available since Cab Grid Pro v4.5.2 and is only applicable where the luggage input is hidden by default (e.g. the tickets or time layouts).

ORIGIN & DEST
ORIGIN and DEST shortcode attributes were added in Cab Grid Pro version 3.2.

These attributes allows you to pre-define (set the drop-down) for either pick up or destination.

Setting the ‘ORIGIN’ attribute to a value that exactly matches one of your place names will pre-define the pickup location drop down for this instance of the Cab Grid Pro plugin.

Setting the ‘DEST’ attribute to a value that exactly matches one of your place names will pre-define the drop-off location drop down for this instance of the Cab Grid Pro plugin.

The values set for ORIGIN and DEST must exactly match (case-sensitive) a place name set in the AREAS tab. The corresponding checkbox under the ‘Origin’ or ‘Destination’ columns in the AREAS tab must also be checked/ticked and the origin/dest entered must also be part of the GROUP.

For PASSENGER and TICKET layout modes, if both ORIGIN and DEST attributes are set and matched, the Cab Grid Pro interface will perform the calculation and return a price. In VEHICLE mode, the visitor must select a vehicle for the calculation to be performed.

Setting only one of either ORIGIN or DEST attributes will simply pre-populate the corresponding drop down and no calculation will be performed. The customer can then go on to select or change options to get a price and book as normal.

SYNTAX: [cabGridPro origin="place1" dest="place2"]

VEHICLES
This shortcode attribute was added in Cab Grid Pro version 4.3.4.

The ‘vehicles‘ attribute is used to restrict the vehicles the instance uses for price calculations.

If set, in ‘vehicles’ layout mode, only the identified vehicles will be displayed. In other modes, the price lookup will be restricted to the vehicles identified. This will also restrict the maximum capacity for passengers, luggage, etc. to that of the highest capacity vehicle identified.

The vehicles attribute expects vehicle ID numbers separated by a comma. The ID of a vehicle can be found by hovering the mouse over the vehicle name field under the VEHICLES tab on the Cab Grid Pro admin page:
Get vehicle ID
SYNTAX: [cabGridPro vehicles="6,1,4"]

From Cab Grid Pro version 5.0, when in VEHICLE layout, the vehicles will be displayed in the order specified in this shortcode attribute. So, in the example above, the calculator will be laid out, left to right, starting with the vehicle with ID ‘6’, then ‘1’, then ‘4’.

CLASS
This shortcode attribute was added in Cab Grid Pro version 4.5.6.

The ‘class‘ attribute is used to assign additional CSS classes to a Cab Grid Pro calculator instance. Class names are separated with a space. This is useful when targeting specific Cab Grid instances to style.

SYNTAX: [cabGridPro class="myCustomClassName anotherClass"]

Custom class names can also be assigned in the widget properties box when displaying Cab Grid taxi fare price calculator in a sidebar area.

SINGLE
This shortcode attribute was added in Cab Grid Pro version 5.0.

The ‘single‘ attribute is used to limit either the origin or destination drop down lists to a single place. (Note; this is similar to selecting only one place as an origin or destination in the AREAS tab, but using the single attribute, the setting can be applied to a specific instance of the Cab Grid taxi price calculator only, rather than all instances.)

The ‘single‘ attribute can be set to either ‘origin‘ (to limit the pick-up location list) or ‘dest‘ (to limit the destination location list). When the ‘single‘ attribute is defined the corresponding ‘origin‘ or ‘dest‘ attribute must also be defined.

SYNTAX: [cabGridPro single="origin" origin="Place Name"]
[cabGridPro single="dest" dest="Other Place"]

ONEWAYRTN
Preset either one-way or return journeys.

This shortcode attribute was added in Cab Grid Pro version 5.1.11

The ‘onewayrtn‘ attribute is used to preset the one-way/return icon. It accepts the following values for:

One-way

  • n
  • oneway
  • one-way

Return

  • return
  • rtn
  • y

SYNTAX: [cabGridPro onewayrtn="one-way"]
[cabGridPro onewayrtn="return"]

PASS, LUGG, TICK & TIME
These attributes were introduced in Cab Grid Pro version 5.2.4. They pre-define the number of passengers, quantity of luggage, number of tickets, or length of time (units).

Note; setting these attributes within the Cab Grid Pro shortcode will override any values defined via the Defaults Add-on or _settings.php file. However, if values are set in a link via query string parameters, the shortcode attributes will ignored.

PASS
The ‘pass’ attribute is used to set the number of passengers shown when the Cab Grid Pro calculator loads in ‘passengers’ layout.
SYNTAX: [cabGridPro pass="5"]

LUGG
The ‘lugg’ attribute is used to set the quantity of luggage items shown when the Cab Grid Pro calculator loads in ‘passengers’ layout.
SYNTAX: [cabGridPro lugg="3"]

TICK
The ‘tick’ attribute is used to set the number of tickets shown when the Cab Grid Pro calculator loads in ‘tickets’ layout.
SYNTAX: [cabGridPro layout="tickets" tick="4"]

TIME
The ‘time’ attribute is used to set the quantity of time units shown when the Cab Grid Pro calculator loads in ‘time’ layout.
SYNTAX: [cabGridPro time="8" layout="time"]

DROPDOWN

Change the Cab Grid Pro calculator input type displayed between regular text (number) inputs and drop-down menus (HTML <select> boxes).

This shortcode attribute was added in Cab Grid Pro version 5.6.6

Effected inputs: Number of passengers, Quantity of Luggage, Number of Tickets, Number of Time Units.

The ‘dropdown‘ attribute is used to set the appearance of number inputs in the Cab Grid Pro calculator. It accepts the following values for:

Number Example:

  • n

Drop-down Example:

  • y

SYNTAX: [cabGridPro dropdown="n"]
[cabGridPro dropdown="y"]

Default value: ‘n’
The regular number input field allows mobile devices to show a native number input interface and is preferred.

Note: This option can be defined globally via the _settings.php file (or defaults add-on).

Tags: , , , , , , , , , , , , ,

x
  •  
  • Discount/Promo Code
  • Extras

    Select additional items to add to your booking

    • Water

      Water

      Chilled mineral water

      -+

      $1.491.49


No price found for this journey