Skip Navigation

[Resolved] Insert Content Template into Archive page using Elementor template

This thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to insert a Content Template into an archive page by adding it to an Elementor archive template, but nothing is showing up.

Solution: The recommended way to build archives with Toolset is by going to Toolset > WordPress Archives and creating the archive here. If you want to use Elementor templates instead, you should trash and WordPress Archives or Content Templates you have associated with this taxonomy. Otherwise, Elementor and Toolset templates can cause conflicts with one another.

Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-153372
https://toolset.com/documentation/user-guides/using-toolset-with-elementor-page-builder/

This support ticket is created 5 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Ben 5 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1174776

Ben

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?

#1174902

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

#1175322

Ben

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?

#1176068

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.

#1177712

Ben

Thank you Christian.

I will use the Types Shortcodes directly inside an Elementor template for the archive.