Skip Navigation

[Resolved] Can I assign multiple template to one specfic post type?

This support ticket is created 2 years, 6 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by yang-anL 2 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2346657

Tell us what you are trying to do?

I watched the tutorial "Assigning Templates to Posts Conditionally in WordPress" . It is said that if I have two categories of shoes to sell, I can create two templates. But I don't know the product categories for “Trainers” and “Heels” are post type itself, or categories under a post type (say, Shoes Product)? Because I found that when I create the first template for one post type (say, Shoes Product), I can use any custom field contents of this post type. Everything is ok. However, if I create the second template, now I can't use the custom field of Shoes Product, although having assigned the usage to Shoes Product. Is it normal ? How do I design the second template for the same post type but under different category?

So it is the question: If I have two type of posts, they are quite similar ( maybe 80% the same custom fields will be used), how do I arrange their post type, custom field, and template?

My first thought and what I doing now is :
Because they are the similar posts , so I collect them to the same post type, creating a custom field set including every field I will use. And I make two templates, each one has its design and field used.

For example,
Post type : Shoes Product
Custom fields : Field group for Shoes Product ( including 10 field contents)
Taxonomies: Trainer , Heels
Template: Template for Trainer( maybe including 6 field contents from field group), Template for Heels( maybe 5 field contents but some of them are different to Trainer's)

But, If I have assigned the template for Trainer to post type "Shoes Product", I can't use the field group for Shoes Product again for any other template ......

So, how do I arrange my toolset structure? Just take this Shoes Product case for example ? Thank you!

Is there any documentation that you are following?
https://toolset.com/lesson-placement/lesson-placements-1621067-2019391/

Is there a similar example that we can see?

What is the link to your site?
hidden link

#2346761

Hi,

Thank you for contacting us and I'd be happy to assist.

This issue with the dynamic source selection is already reported. Currently, if a content template has conditional settings to be assigned/displayed, the correct post source and its relevant custom fields can't be selected.

The fix for this issue is included in the upcoming plugin releases, and they are expected to be released very soon.

For now, a workaround can be to use a single content template for all posts in a post type and inside it use conditional blocks, to show different content based on taxonomies or any other criteria, as needed:
https://toolset.com/course-lesson/using-toolset-conditional-block/

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2346881

My issue is resolved now. Thank you!