Shortcode / Computed Value or HTML in WP Posts Table
There are many powerful features provided by Ninja Tables, and one of them is Shortcode/Computed Values.
For particular purposes, WordPress enables the use of a few default shortcodes. These shortcodes can be used on your table with the help of Ninja tables.
Follow this demonstration to know about the application of this feature.
[Keep in mind that you need to install the WooCommerce plugin on your site for product table display. A product table installing a WooCommerce plugin is shown here.]
First, you need to make a table using the Ninja Tables plugin. So go to the plugin’s dashboard and click the WP Posts option. Therefore the interface changes accordingly. Then, place the table title in the input area, similar to the Product Demo.
Then check the appropriate field types to be shown on your table and proceed to the Selected Types section by clicking on the right arrow.
Then each selected field will be transferred to the Selected Types section.
Tap the Next button and you’ll find options to configure selected field properties.
Next, switch the required properties to the Selected Properties by checking & clicking the right icon.
Click on the Save button & then a table will be generated automatically.
Create a new column by clicking on the Add Column at the top of the table to use the Shortcodes / Computed Value in Ninja Tables.
Now go to Dynamic Data Settings and click Field Type, there will be a drop-down option. From there click on the Shortcode / Computed Value or HTML.
By clicking the Shortcode / Computed Value or HTML option, you must use a shortcode to fill in the field input value field.
Follow the instructions given under Field Value until entering the value.Then, place the shortcode needed in the input fields. You can get the pre-built shortcodes from the docs.woocommerce.com website, or you can get those pre-defined shortcodes from various sources that are allowed in WordPress.
The short-code is given in the Field Value input field to add to the cart.
Now, you will see a new column titled Buy Now with its value generated in the admin section.
Then, tap on the Preview button to display the interface’s final output.
This is how you can use Shortcode / Computed Value or HTML in WP Posts option of Ninja Tables.