Hi guys -
Here’s my use case: I am working on a site dedicated to one hobby. I will let practitioners of that hobby share and recommend resources useful for that hobby.
The minimum structure for such a scenario is:
- a “practitioner” CPT: used by users to display information about them from custom fields and taxonomies linked to this CPT
- a “resource” CPT: used to display resources and additional information from custom fields and taxonomies linked to this CPT
- a “recommendation” CPT: used as an intermediary CPT to implement a many-to-many post relationship between the 2 previous CPTs, so with the 2 previous CPTs set as Parents
Note: I am completely open to replacing the “practitioner” CPT by the wordpress user profile with added custom fields if that makes my use case easier, but only if I can define the layout of the user profile using either a content template, Layout or even Beaver Builder, but I need to have fine-grained control on it, which seems difficult as I understand it.
Here is the context:
- users can register as a wordpress user, and from there create their “practitioner” profile by filling a CRED form with custom fields creating a “practitioner” CPT post
- they can then navigate to a “resource” CPT post on the front-end
Here is what I want to achieve:
- when they are on the “resource” post front-end, they see a button (in my mind, the submit button of a CRED form)
- when they click on that button, which would say something like “Recommend this”, then a CRED form is submitted
- the CRED form would:
- create a “recommendation” CPT post
- assign as parent the “resource” CPT post on which page they currently are and where the CRED form is placed
- assign as parent the “practitioner” CPT post for which the current user is the author (users are not expected to create more than 1 “practitioner” post)
Given that my only real hard needs are to
- let user recommend resources with 1 click
- display a list of the resources recommended by a user on their “practitioner” post
- display a list of the practitioners/users who recommend a resource on each resource page
My questions would be:
- would the general structure of using CPTs like this make sense? If not, I am totally open to better suggestions 🙂
- if yes, would you have any pointers as to how I could structure the CRED form on the “resources” post to automatically assign the correct parent posts in the form?
I have searched extensively through the forum but couldn’t find any info on that specific use case 🙁
Many thanks!
Best,
- Julien