Tableau integration plugin for Craft
This plugin requires Craft CMS 3.x and a Tableau 2.x server.
Install ShipStation Connect from the Plugin Store or with Composer
Go to the Plugin Store in your project’s Control Panel and search for Tableau Connect.” Click on the “Install” button in its modal window.
Open your terminal (command line) and run the following commands:
# go to the project directory
cd /path/to/my-project
# tell Composer to load the plugin
composer require fostercommerce/tableauconnect
# tell Craft to install the plugin
./craft install/plugin tableauconnect
After installing with composer, go to the Craft control panel plugin settings page to install and configure the settings for the plugin.
This is the URL to your Tableau installation, example: https://tableau.my-org.com
Enable this setting if you need to access views which require user authorization.
Note: This uses Tableau's "trusted" scheme which requires your web server's IP address to be add to the Tableau servers list of trusted addresses. See Adding Trusted IP Addresses
view
The view to render.
{{ craft.tableauconnect.renderVisualization('Workbook/SomeView', {...}) }}
options
Supports all options supported by Tableau JS API
onFirstInteractive
and onFirstVizSizeKnown
should be passed in as strings to Tableau Connect.
See onFirstInteractive and onFirstVizSizeKnown event classes for details about the function callback arguments.
requiresAuthorization
Override the system-wide authorization configuration for this specific view:
{{ craft.tableauconnect.renderVisualization('Your/View', {...}, false) }}
{{craft.tableauconnect.renderVisualization('Your/View', {
hideTabs: true,
hideToolbar: true,
width: '600px',
height: '480px',
onFirstInteractive: 'myCustomOnFirstInteractive',
onFirstVizSizeKnown: 'myCustomOnFirstVizSizeKnown',
})}}
{% js %}
/**
* args: {
* key: Key applied to visualization container
* container: Element visualization is loaded into
* }
*/
function myCustomOnFirstInteractive(e, args) {
// Do something...
}
/**
* args: {
* key: Key applied to visualization container
* container: Element visualization is loaded into
* }
*/
function myCustomOnFirstVizSizeKnown(e, args) {
// Do something
}
{% endjs %}
If the "Requires Authorization" setting is enabled, you can check if a logged in user is authorized by Tableau to view a visualization. If the setting is disabled, this will always return true
.
{% if craft.tableauconnect.token %}
<!-- Render visualization -->
{% else %}
Not authorized to view visualization
{% endif %}
<iframe
src="{{craft.tableauconnect.embedUrl('Your/View')}}"
>
</iframe>