Learn how to generate and place Drupal shortcodes and extend the shortcode using arguments, which are values passed in the code to customize the experience.
Are you new to Drupal? Please read the first article in this series for an introduction to our Drupal integration.
Accessing the features mentioned in this article
Where can I find this feature using the top menu?
- Manage > Integrations > Website Integration > Drupal
What more do I need to use this feature?
- Admin permissions to manage integrations.
- A hosted website with free Drupal software.
- Ability to copy and paste into your website code or have some helpful person do this for you!
Which Checkfront version supports this feature - classic items, classic products, or both?
- This feature is available in both our classic version using classic items (Inventory > Items) and our classic version using classic products (Inventory > Products). → Learn more about products
What is a shortcode?
A shortcode is a small, simplified code or keyword for a longer piece of content or function. Its meaning depends on the context.
In Drupal, a shortcode is written in square brackets, e.g. [checkfront options=tabs] or [checkfront options=category_select.
It’s a shortcut that tells Drupal to run some code and display a feature without you needing to write additional code.
Generating the shortcode
By now, you should have selected all the previous options that make the most sense for your requirements. Now, it's time to generate the shortcode for your website!
Click the Generate Code button and copy the resulting shortcode to your clipboard. The basic shortcode generated looks like this:[checkfront]
Placing the shortcode
With the shortcode pasted to your clipboard, you can head back to Drupal and locate/create the page/post where you would like to embed the booking portal.
- Place the shortcode wherever you want the portal to appear. This placement may be before, after, or within your page content.
- Make sure you select Full HTML from the Text Format field.
Using arguments with the shortcode
You can add arguments from the list below, for example options=tabs, to shortcodes to control how the booking portal appears and the information it contains. The example above shows what this shortcode with an argument might look like.
Extending the shortcode with arguments
Following is a list of arguments that you can apply to the basic [checkfront] shortcode to change the look and behaviour of your booking portal.
| Type | Shortcode + Arguments | Description |
| Inventory | [checkfront item_id="3,8,37"] |
Show specific items or products |
[checkfront category_id="2,3"] |
Show specific categories | |
[checkfront filter_category_id="3"] |
Limit upcoming events to a specific category | |
| Options | [checkfront options=tabs] |
Tabs as categories |
[checkfront options=category_select |
Dropdowns as categories | |
[checkfront options=hidesearch] |
Hide search and calendar. | |
[checkfront options=hidedates] |
Hide date picker | |
[checkfront options=tabs,hidesearch,hidedates] |
Together, they would look like this. | |
| Discount Code | [checkfront discount_code="insert_code"] |
Include an automatic discount code |
| Language | [checkfront lang_id: "en"] |
Set default booking portal language |
[checkfront locale_id: en_US"] |
Set the default customer language. Customers can change this from the menu bar. Supercedes lang_id | |
| Style | [checkfront style="color: #000000"] |
Font colour |
[checkfront style="font-family: arial"] |
Font-family | |
[checkfront style="background-color: #873333"] |
Background colour | |
[checkfront style="color: #000000; background-color: #873333; font-family: arial"] |
Font styles combined | |
| Date | [checkfront date="20141224"] |
Fast forward to a specific date |
[checkfront end_date="20140131"] |
Add an end date | |
| Tracking ID | [checkfront tid="promo-page"] |
Tracking ID |
Frequently Asked Questions
-
Is it possible to have multiple shortcodes on the same webpage?
No. You can only have one shortcode per webpage. If you want multiple integrations on the same webpage, you need to add generated Booking Widget code as HTML.
|
Browser session cookies Be sure to allow browser cookies in the current browser session. Not accepting cookies may prevent the plugin from loading properly. |
< Configuring advanced options for the Drupal plugin