Hi Gary
Thanks for the feedback
We do not have a GUI for conditionally applying a Content Template to a single post type based on conditions, and I can imagine that, although very helpfull, having such a thing would be maybe a usability problem. You know, there are too many condition sources (field values, autor, time, post relationships, taxonomies, combinations of some of those, etc etc) that in the end it would be quite difficult to set. As I sometimes like to point out, having a GUI for something doe snot necesarily makes it easier to use.
But on the other hand, we do have an API that you can use for this. We have a filter that is precisely in place for this kind of usage:
https://toolset.com/documentation/user-guides/views-filters/wpv_filter_force_template/
That filter basically checks that we are using a Content Template, checks the post that is involved, and identifies the situation (in your case, a single post of a given post type), and lets you modify the Content Template that will be finally applied. Think of this as a way to take a situation and alter which Content Template will be used, which sounds to me exactly what you are asking for.
In your case, I would do something like this (note that I did not test the code, I am just thinking aloud and you might need to adjust it):
add_filter( 'wpv_filter_force_template', 'prefix_select_content_template_by_active_status', 99, 3 );
function prefix_select_content_template_by_active_status( $template_selected, $id, $kind ) {
if ( $kind == 'single-your-post-type-slug' ) {
$act_status = get_post_meta( $id, 'your-field-slug' );
if ( $act_status == 'option_one' ) {
$template_selected = 123; //Adjust to the Content Template ID that you want to use in this case
}
}
return $template_selected;
}
Something like that should do the trick. Again, note that the key word is "like that", but this should give you a starting point to play with the thing.
Hope it helps.
Regards.