1. Home
  2. Docs
  3. Index
  4. Shortcodes
  5. Shortcode ‘wpdataaccess’

Shortcode ‘wpdataaccess’

Use shortcode wpdataaccess to show database tables and views on your website. jQuery DataTables is used to provide dynamic HTML tables supporting pagination, sorting and searching. Choose between flat or responsive tables.

IMPORTANT

You need to explicitly grant access to tables shown on your website! Your table and view data will not be shown on your website without this step! Follow these steps to grant access to a table or view you allow users to add it’s content to your website:

  • From the menu click “WP Data Access” > “Manage Plugin”
  • Click on tab “Front-End Settings”
  • Click on the table or view your want to grant access to (multiple selections possible)
  • Save your front-end settings

Shortcode Parameters

The following parameters are supported:

  • pub_id (publication id)
  • table (table or view name)
  • columns (comma seperated list of columns, default: * = all columns)
  • responsive (yes or no, default: no)
  • responsive_cols (number of columns shown on the table, default = 1)
  • responsive_type (modal, collapsed (default) or expanded)
  • responsive_icon (yes or no, default: yes)

Data Publisher

You can use the Data Publisher to create a publication. Every publication created with the Data Publisher tool has a unique publication id (pub_id). If you add parameter pub_id to your shortcode, all other parameters are taken from your publication. No further action is needed. The shortcode for a specific publication can be copied to your clipboard with the Data Publication tool and looks like:

[wpdataaccess pub_id="17"]

User defined shortcodes

You can also add a shortcode manually. For manually added shortcodes parameter table is mandatory. All other parameters are optional. Tables are shown in flat format by default. In it’s simplest form usage looks like:

[wpdataaccess table="wp_customers"]

Was this article helpful to you? Yes No

Leave a Reply

Your email address will not be published. Required fields are marked *