WordPress plugin

Embedding CloudTables in your WordPress site is made easy through our plug-in for WordPress.

Installing

The CloudTables plug-in for WordPress is available in the WordPress plug-ins directory. As such, installation can be done directly from your WordPress dashboard:

  1. In your WordPress admin panel, go to Plugins -> Add New
  2. Search for "CloudTables"
  3. Click the Install now button for the CloudTables plug-in.

Note that if the automatic download and install fails (e.g. write permissions on your server), you can manually download the software and install it in the wp-content/plugins directory for your WordPress install.

Once installed click the Settings option for the CloudTables plug-in or use the WordPress admin menu to go to Settings -> CloudTables. Here you will now need to fill in information so the plug-in can securely connect to your CloudTables application:

  1. Hosting type: To connect to your self-hosted install of CloudTables, set this option to Self-hosted
  2. Host: The address of your self-hosted install. This might be an IP address, a host name or a domain name if you have DNS set up for it. Don't include the protocol (http or https) or the port - those are separate options.
  3. Port: Typically web servers run on port 80, which will be used if this field is left empty, but when running multiple Docker containers, you might have your CloudTables instance on a different port (e.g. 8080 is common). If you are using a port other than 80, enter it here.
  4. SSL: If you have configured your web-server for CloudTables to use SSL certificates for secure communication (we recommend doing so for production deployments) enable this option. Otherwise, for non-SSL (i.e. http://) leave it as disabled.
  5. Certificate signing: When SSL is enabled, you might be using either a certificate from a recognised certificate authority, such as Let's Encrypt or a self-signed certificate. Select the option that is suitable for your SSL certificate to ensure the correct security level is applied.
  6. Editor API Key: This is the API Key that will be used for users on your site who have editing permissions. Typically you would use an API key which has read and write access for this field. Your API Key's can be found on the security pages.
  7. Visitor API Key: The API Key that will be used for users on your site who do not have editing permissions (normally visitors to your site who have not logged in). Typically this would be a key which has read access only.

Click "Save Changes" to save. The plug-in will then connect to the CloudTables server and show the connection status. If all is well a list of data sets that you have available (based on the Editor API Key) will be shown at the bottom of the page.

Use

When the CloudTables plug-in for WordPress is installed, you'll be able to embed tables directly into your WordPress pages and posts using WordPress' built in block editor, or through the use of a short code if you prefer.

Block editor

Create a new block by clicking the "+" icon in the page / post editor. Select the CloudTables option from the Layout Elements category, or search for "CloudTables". This will show the CloudTables logo where the table will appear on your page.

In the inspector panel on the right, there is a Properties panel. From here you can select the data set that you wish to embed into the page. Note that multiple CloudTables can be shown on the same page no problem.

You might also note that there is an API key option in the properties panel. This value is optional, but can be used to specify a particular API key, if you wish to embed this table with specific access rights, rather than the global keys given in the settings page (see above).

Short codes

If you prefer Using WordPress' classic editor, you can use CloudTables through short codes - specifically the format to use is:

[cloudtable id="{datasetId}" key="{optionalApiKey}"]

where:

  • {datasetId} is the ID of the data set you want to show. The data set ID can be found on the "Data" tab of the data set in question, or in the list of data sets you have access to in the CloudTables settings for WordPress.
  • {optionalApiKey} is an optional parameter - normally you could leave this off. It is provided as a way to specify a particular API key if you wish to embed this table with specific access rights, rather than the global keys given in the settings page.

CloudTable not showing on home page

One common issue that you might stumble into is your embedded CloudTable showing perfectly in your post, but not on the home page! This is because WordPress automatically generates a 55 word excerpt for each post and in the process of doing so strips short codes such as those used to insert CloudTables.

Whether this is an issue depends upon the theme you are using, some will actually render the CloudTable in the post summary, while others don't:

  • Twenty Twenty - will display
  • Twenty Twenty One - won't display
  • Twenty Twenty Two - won't display

How to fix

If you want the CloudTable to appear in the excerpt regardless of the theme you are using, you can provide a custom excerpt for a post, and this can have short codes in it.

Edit the post in question and in the extra options on the right of the display find the excerpt input. Type in the summary for your post, and use a short code as described above. It will then appear on the home page as well as the actual post.