11.3.2.4. Templates Tab

In this tab, you can create templates for the current item. You can use the short codes that are shown as buttons in this tab. In addition, you can use custom short codes you defined in Custom Content Selectors for Shortcodes setting. To copy any short code, just click its button. Then go to the template input and paste it. The short codes must be in [short-codename] format. For example, if a short code’s name is wcc-item, then you should enter [wcc-item] to use the value of this short code.

Important

When there are more than one template, a random one will be selected for each found item.

Important

When testing, configurations under Find-Replace Tab, General Tab, and Calculations Tab will be applied first, respectively.

11.3.2.4.1. Remove item if it is empty?

When you check this, if the item is found to be empty, i.e. an empty string, it will be removed from the results. In other words, it will be treated as if it was not found at all. It will not be included in the results. The templates will not be applied.

11.3.2.4.2. Templates

Define your templates here. If there are more than one, a random template will be selected. You can use button to test your template.

Note

The test will only replace [wcc-item] shortcode. So, no need to worry when the other shortcodes are not replaced in the test results. They will be replaced when crawling the posts. If you really want to see all shortcodes replaced, then you can use Tester Page.

../../../_images/options-box-templates-test-button.png

Fig. 11.16 An example template and its test results.

An example template and its test results can be seen in Fig. 11.16. You can see that [wcc-item] short code is replaced with 15,003.52 although the original test data is 15. This is because there are other options configured in Calculations Tab. Those options are applied to the data before the template is applied. Moreover, you can also observe that [wcc-main-title] is not replaced with the post title, because the test does not replace shortcodes other than [wcc-item].