Shortcode / Computed Value or HTML in WP Posts Table
The latest version of Ninja Tables plugin comes up with some dynamic features that enhance your table creation capacity. One of the latest components of the plugin is Shortcode / Computed Values.
WordPress allows its users to use some pre-defined short-codes for specific purposes. You can use these short-codes on your table using Ninja Tables.
Let’s have a close look at the demonstration of the functionality.
[Note that for product table demonstration you need to install WooCommerce plugin on your site. I am showing a product table installing a WooCommerce plugin.]
First of all, create a table using the Ninja Tables plugin. To do so, you need to go over to the Ninja Tables dashboard. Click on the WP Posts option.
Then interface will change accordingly. Next, put the table title as I have put the Product Demo in the input field.
Then check the required field types that are to display on your table and move to the Selected Types section clicking on the right arrow.
Then every selected fields will transfer to the Selected Types section.
Click on the Next button and you will find the options to set the properties of selected fields.
Then move the required properties to the Selected Properties section by checking and clicking on the right icon .
Then click on the Save button, and then a table will be created automatically.
To use the Shortcodes / Computed Value in Ninja Tables we have to create a new column by clicking on the Add Column on top of the table.
Then go over to the Dynamic Data Settings and click on the Field Type, a drop-down option will appear. From there click on the Shortcode / Computed Value or HTML option.
After clicking Shortcode / Computed Value or HTML option you have to fill up the Field Value input field using a shortcode.
Follow the instruction given under the Field Value before inputing the value.
Now, put the required shortcode in the input fields. You can get the pre-built shortcodes from docs.woocommerce.com site or you can get these pre-defined shortcodes from different sources that are allowed in WordPress.
I am putting the short-code for add to cart in the Field Value input field.
Now, in the admin section, you can see a new column has created entitled Buy Now with its value.
Next, click on the Preview button to see the ultimate output of the interface.
This is how you can use Shortcode / Computed Value or HTML in WP Posts option of Ninja Tables.