TourCMS, a leading online booking and channel management solution is operated by Palisis.

Contact Info

Palisis AG
Florastrasse 18A
8610 Uster
support@palisis.com
+41 44 533 40 40

Follow Us

home > support > web design > wordpress plugin > meta data and shortcodes

Meta data and Shortcodes

When a Tour/Hotel is saved in WordPress some of the standard information about that Tour/Hotel (Code, Price, Booking URL, what's included / excluded etc) is downloaded from TourCMS and saved as Custom Meta Data

This information can then be displayed by page templates / widgets by using the get_post_meta() function (the included widgets and theme do just that) or added to the description using shortcodes.

Using shortcodes

When editing the description for a Tour/Hotel in WordPress just add the shortcode for the information you wish to display then save. For example, to show the text "Code: " followed by the Tour Code stored in TourCMS you could type:

Code: [tour_code]

Which would output:

Code: ABC1

The full list of shortcodes and meta data are displayed below.

Shortcode clashes / conflicts with other plugins or themes

If your theme or another plugin uses the same shortcodes as the TourCMS plugin you may find the below shortcodes do not function correctly. In this case you can prefix any of the shortcodes below with the text "tourcms_".

So for example to output the itinerary you would usually use the shortcode [itinerary], you can alternatively use the shortcode [tourcms_itinerary], it functions in exactly the same way. You can mix and match "tourcms_" prefixed and non prefixed shortcodes, either works fine.

Full List

Shortcodes available with the TourCMS WordPress plugin
Shortcode Meta data Description
[available] tourcms_wp_available Text explaining when the Tour runs / Hotel is open
 
Example: "Year round" or "May to Oct" (free text)
[book_link] n/a

A clickable link to the booking engine for the current Tour

If the tag is wrapped around some content then the content will be used as the link text, if not then the text entered in the plugin settings page will be used, if no text is loaded in the plugin settings the default text "Book Online" (or a translated version) is used.

The following parameters can further control the booking link style:

Parameter Description
style By default the link will open in the same window, specify style="popup" to open in a popup window instead
height If the popup window style is being used, this will control it's height (in pixels)
width If the popup window style is being used, this will control it's width (in pixels)

Example:

[book_link style="popup" width="800" height="400"]Check availability[/book_link]

...will output a link with the text "Check availability" that opens in a popup window 800px wide and 400px tall.

For more control use the [book_url] shortcode (below), template designers can use the tourcms_wp_book() hook.

[book_url] tourcms_wp_book_url The URL to the online booking engine for the current Tour
 
Example: https://live.tourcms.com/......
[duration_desc] tourcms_wp_duration_desc The duration description loaded in TourCMS
 
Example: "Half day" or "7 nights" (free text)
[essential] tourcms_wp_essential Essential information on the Tour / Hotel such as what to bring, line breaks are replaced by <br> tags.
 
Example: n/a (free text)
[extras] tourcms_wp_extras Brief summary of any extras that can optionally be booked
 
Example: n/a (free text)
[from_price_display] tourcms_wp_from_price_... A rounded version of the lead in price including currency details
 
Example: £475
[from_price] tourcms_wp_from_price The raw lead in price for the current Tour
 
Example: 475.00
[geocode_start] tourcms_wp_geocode_start Comma separated longitude, latitude for the start location
[geocode_end] tourcms_wp_geocode_end Comma separated longitude, latitude for the end location
[inc] tourcms_wp_inc Information on what is included with the Tour, line breaks are replaced by <br> tags.
 
Example: n/a (free text)
[ex] tourcms_wp_ex Information on what is excluded (not included) with the Tour, line breaks are replaced by <br> tags.
 
Example: n/a (free text)
[redeem] tourcms_wp_redeem Redemption instructions (for any vouchers that might be issued for the Tour)
[itinerary] tourcms_wp_itinerary The itinerary information
 
Example: n/a (free text)
[location] tourcms_wp_location The "Primary location" text for the Tour
 
Example: n/a (free text)
[longdesc] tourcms_wp_longdesc The "Long description" text for the Tour
 
Example: n/a (free text)
[exp] tourcms_wp_exp Experience / Highlights.
 
Example: n/a (free text)
[pick] tourcms_wp_pick The pick up / drop off information text.
 
Example: n/a (free text)
[rest] tourcms_wp_rest Information on any restrictions that apply, line breaks are replaced by <br> tags.
 
Example: n/a (free text)
[sale_currency] tourcms_wp_sale_currency The three letter code for the currency used
 
Example: EUR
[shortdesc] tourcms_wp_shortdesc The "Short description" text for the Tour, line breaks are replaced by <br> tags.
[summary] tourcms_wp_summary The "Summary" text for the Tour
[tour_code] tourcms_wp_tour_code The alphanumeric code for the Tour/Hotel
 
Example: ABC1
[tour_name] tourcms_wp_tour_name The name for the Tour/Hotel
[doc_link] tourcms_wp_document_url_0
tourcms_wp_document_desc_0
Output a link to view the document uploaded against the tour in TourCMS.
 
By default the link text will be the description entered in TourCMS, override this by wrapping the tag around your desired link text, e.g:
 
[doc_link]Custom link text[/doc_link]
 
By default the link will open in a new tab, to change this add a blank target attribtue:
 
[doc_link target=""]
n/a tourcms_wp_image_url_X tourcms_wp_image_url_thumbnail_X
tourcms_wp_image_desc_X
Access the images and their associated thumbnails and descriptions. X should be replaced with a number from 0 to 9 to access the related image.
 
View sample template code
[vid_embed] n/a Display the video for this tour.
 
The default height and width can be configured in the plugin settings, or overridden on a specific video by adding attribtues to the shortcode. For example, to display the video at 640x480:
 
[vid_embed width="640" height="480"]
 
By default the embed includes additional code so that videos are responsive, if you have a responsive theme that resizes itself on mobile devices, the video embed should resize too. This behaviour can be switched off in the plugin settings, or by adding the attribute responsive="no" to the shortcode.
n/a tourcms_wp_video_service_0 tourcms_wp_video_url_0 tourcms_wp_video_id_0 Video service will currently be either "youtube" or "vimeo", ID is the unique identifier for that video on that service, URL is the link to view the video on that service.
n/a tourcms_wp_has_sale 1 if the Tour has a bookable date in the future, otherwise 0
 
Example: 1
n/a tourcms_wp_has_sale_jan
tourcms_wp_has_sale_feb
....
tourcms_wp_has_sale_dec
Rolling 12 month availability overview, will be 1 if the month has at least one bookable date in it, otherwise 0.
E.g. if we were currently in August 2013 then tourcms_wp_has_sale_jan will represent availability for January 2014).
n/a tourcms_wp_last_updated Unix Timestamp storing when the TourCMS information for this Tour/Hotel was last refreshed, see Cache Settings for an explanation
 
Example: 1276529319
n/a tourcms_wp_hands_??? Health & safety
 
Information regarding enhanced cleaning / health & safety provisions, automatically generated from the list of health & safety items currently configurable within TourCMS.
 
The list may be reduced/extended in future however the current list is:
 
tourcms_wp_hands_face_masks_requied_for_travelers
tourcms_wp_hands_face_masks_requied_for_guides
tourcms_wp_hands_face_masks_provided_for_travelers
tourcms_wp_hands_hand_sanitizer_available
tourcms_wp_hands_social_distancing_enforced
tourcms_wp_hands_regularly_sanitized
tourcms_wp_hands_equipment_sanitized
tourcms_wp_hands_transportation_vehicles_sanitized
tourcms_wp_hands_guides_required_to_wash_hands
tourcms_wp_hands_temperature_checks_for_staff
tourcms_wp_hands_temperature_checks_for_travelers
tourcms_wp_hands_contactless_payments_for_extras
 
The value can be one of: NOTSET / YES / NO
n/a tourcms_wp_rates JSON array of rates. Call the PHP function tourcms_wp_rates to get as a PHP array.
$rates = tourcms_wp_rates();

// Loop through them and display a bit of info about each 
foreach($rates as $rate) {
	echo "$rate->label_full ($rate->rate_id)<br>";
}

// Outputs 
// Adults (r1)
// Children (r2)
n/a tourcms_wp_dates JSON array of available dates, includes start dates and a flag indicating the special offer type. Designed for displaying in a calendar.
 
Call the PHP function tourcms_wp_dates to get a simple PHP array of just the dates as strings.
$dates = tourcms_wp_dates();

// Display them all in a comma separated list 
echo implode(",", $dates);

// Ouputs 
// 2022-01-01,2022-01-08,2022-01-15 

 
Call the PHP function tourcms_wp_dates_deals to also include details of whether each date is a special offer.
$dates = tourcms_wp_dates_deals();

foreach($dates as $date) {

	$date_string = $date->d;
	$is_offer = $date->s > 0;

	if($is_offer)
		$date_string .= " SPECIAL OFFER";

	echo "$date_string<br>";
}

// Outputs 
// 2022-01-01 
// 2022-01-08 SPECIAL OFFER 
// 2022-01-15
[tourcms_custom tag="???"] tourcms_wp_custom_??? Custom data
("Extra tour content fields" in TourCMS terminology).
 
Define "Extra tour content fields" in Configuration & Setup in TourCMS, at that point you will define a tag for that field which can be used to display the information in WordPress.
 
To edit the information stored in that custom field for a particular Tour/Hotel just head into Descriptions & Images for that Tour/Hotel and take a look under the Custom data tab.
 
E.g.:
Field: Example Field
Tag: examplefield
The information entered in that field would be imported into a post meta field called tourcms_wp_custom_examplefield and available as a shortcode using [tourcms_custom tag="examplefield"].
 
Note: This Custom data is not currently displayed in the preview table on the Edit Tour/Hotel page in WordPress, this may be fixed in a future update to the plugin.