I am trying to insert a Content Template into an Archive page using the following.
[wpv-post-body view_template="MYCONTENTTEMPLATE"]
I am not seeing the Content Template appear like I expect it to, in fact nothing appears at all. Is this expected behaviour?
It could be expected, depending on what you're trying to accomplish with the Content Template. It depends on:
- Where have you inserted the Content Template shortcode?
- What are the contents inside the Content Template?
If the shortcode is inside the wpv-loop tags in the Loop Editor of a Toolset WordPress Archive, the Content Template should be rendered for each result in the archive. If that's not happening now, try temporarily replacing the contents of this Content Template with some basic text and no shortcodes. This should confirm whether or not the Content Template is being rendered.
If the shortcode is not inside the wpv-loop tags of a Toolset WordPress Archive, then it may not work as expected because you haven't provided a post context. In other words, the shortcode doesn't know which post's content you want to display in the template. You can try adding a specific post ID using the "id" attribute like so:
[wpv-post-body view_template="MYCONTENTTEMPLATE" id="12345"]
Replace 12345 with the numeric ID of a specific post you would like to display. More information about this shortcode here: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-153372
Thanks for your reply Christian!
The Content Template shortcode is being inserted directly onto an Archive page template for a particular taxonomy using Elementor. The contents inside the Content Template are as follows:
[types termmeta='CUSTOMTERMFIELD'][/types]
I don't believe that I can use your suggestion of: [php][wpv-post-body view_template="MYCONTENTTEMPLATE" id="12345"]</code because the ID will be changing dependant on which term is being displayed? I need the ID to be dynamic to whatever term is being viewed.
Does this make any sense in terms of what I am trying to achieve?
Okay the recommended way to create taxonomy archives with Toolset is to go to Toolset > WordPress Archives and create your archive here. If you want to use Elementor Archive templates instead, you should trash any Toolset WordPress Archives or Content Templates you have associated with this taxonomy. Otherwise, there could be a conflict between Toolset and Elementor archives that prevents either from appearing. Then a Types termmeta shortcode displayed inside the Elementor archive template should automatically display information from the current archive term.
Thank you Christian.
I will use the Types Shortcodes directly inside an Elementor template for the archive.