Passer la navigation

[Résolu] Build Logic of View vs. Content Template?

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

Should I always create the Content Template first, then various View(s) to place the Content Template shortcode, and afterward add Content Template(s) into a View(s)?

Solution:

If the content template will be used in only one post view, you can create the post view first, and generate the content template automatically.

If the content template will be used in multiple cases, then you can create the content template first, and display the content template shortcode in where you want, for example

[wpv-post-body view_template="my-ct"]

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body

This support ticket is created Il y a 3 years, 11 months. 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 -

Fuseau horaire du supporter : Asia/Hong_Kong (GMT+08:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par janO-3 Il y a 3 years, 11 months.

Assisté par: Luo Yang.

Auteur
Publications
#2260485

Tell us what you are trying to do? I think I'm doing it all backwards. Now going back to revamp and clean up a website from earlier years. I think I started out applying the wrong Toolset concept. I have been calling a View in some cases and a Content Template (standalone) in other cases. My logic seems faulty.

Q: Should I always create the Content Template first, then various View(s) to place the Content Template shortcode, and afterward add Content Template(s) into a View(s)?

Is there any documentation that you are following? No

Is there a similar example that we can see? No

What is the link to your site? N/A private

#2260701

Hello,

If the content template will be used in only one post view, you can create the post view first, and generate the content template automatically.

If the content template will be used in multiple cases, then you can create the content template first, and display the content template shortcode in where you want, for example
[wpv-post-body view_template="my-ct"]

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body

#2261417

My issue is resolved now. Thank you!