[Résolu] Set template per post for a custom post type
This support ticket is created Il y a 3 années et 9 mois. 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
Hi guys!
I have a question.
I created a custom post type called 'products'. Every product has its own features and design and therefore needs his own template.
Is it possible to set select a template for every post (like we can in pages).
Thanks!
Marc
Hi Minesh, thanks a lot!
Another important part (that i forgot to mention) is that the field sets are different.
So i would love to have the option to select a template and than see the related fields (just like in pages).
Is that possible?
So i would love to have the option to select a template and than see the related fields (just like in pages).
Is that possible?
==>
I'm not sure what exact requirement you have.
Do you mean that you want to allow users to select content template from backend while the edit their post/page? If you can share more details on your requirement with example, I'll be able guide you in the right direction.
Hi Minesh,
Sorry for explaining myself not clear. The idea is simple.
When you create a new page. You pick a template and after saving the related fields are shown for that particular template.
That same pattern (pick a template + save the post + see the correct field set) i want to implement for a custom post type. I don't have the 'template' metabox (that is available in pages) in a custom post type, so is there a way to achieve this.
Hi Minesh, thanks and I still think i haven't explained myself well enough.
Imagine a product detail page that looks completely different for every product and contains completely different types of information. In order to manage those, we need completely different fields for every product. I'm looking for a way to set a different template for every product and see a field set that is specific for that product as well.
Is that possible?
Thanks!
ps. we won't have 100's of posts, there will only be max 15 products.
So, go to Toolset => Content templates
- Add new content template for product X (dont assign this content template to any post type) and add your require fields, example field 1 and 2 and 3
- Add new content template for product Y(dont assign this content template to any post type) and add your require fields, example field 4 and 5 and 6
- Add new content template for product Z(dont assign this content template to any post type) and add your require fields, example field 7,8,9