Hi,
We have custom post types that all have their own content templates assigned.
However when saving posts the content templates dosnt get assigned in the right way.
It says "Template Dynamically Assigned by Toolset" but the template dosnt work and we have to manually select the template every time.
Do you know any solution to fix this issue?
Hi,
Thank you for contacting us and I'd be happy to assist.
If a content template is globally assigned to a single post type, it shouldn't be required to be assigned to individual posts, manually.
Can you please share temporary admin login details, along with the exact steps to see the issue?
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
regards,
Waqar
Hi,
I managed to debug this problem
We where checking for possible templates in our theme code like this
if (function_exists("render_view_template") && get_post_meta($post->ID, '_views_template', TRUE) && get_post_meta($post->ID, '_views_template', TRUE) !== 0) {
For some reason the automatically assigned template dosn't have _views_template meta in post meta anymore
It seems this still works so I'll use it instead
has_wpv_content_template($post->ID);
Thanks for the update and your observation is correct.
In Toolset Blocks 1.5 / Views 3.5, some changes were added to the content assignment mechanism, to introduce the conditional assignment feature.
( ref: https://toolset.com/2021/04/toolset-blocks-1-5-custom-woocommerce-product-and-shop-pages/ )
The assigned template's ID is no longer saved in the "_views_template" meta, but it is still safe to use the "has_wpv_content_template" function.
( ref: https://toolset.com/documentation/programmer-reference/views-api/#has_wpv_content_template )