Tell us what you are trying to do? Right now, my site has biographies, and custom post types, for three different kinds of people: Faculty, Students, and Alumni. I'm wondering if there's a way to simplify things and create a single post type, called Profile. The three custom post types, however, have different fields, and each field group belongs to its own custom post type (an Alumni Field Group belongs to the Alumni custom post type and so on). My question is, what would happen if I set all three field groups to use the Profile custom post type, and the field groups had redundant fields? Is that even possible? Or do I need to configure the system to group shared and unique fields discreetly?
At the moment, I've set this up on a test site. What's happened is that the Alumni and Faculty field groups appear, and the Student field group isn't appearing (despite being enabled in the Screen Options). See attached screenshots. visible field groups.png shows the field groups that are visible on the Add New Profile page, and the other shows the Screen Options on the Add New Profile page.
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? hidden link
My question is, what would happen if I set all three field groups to use the Profile custom post type, and the field groups had redundant fields?
As long as the fields have unique slugs, this is possible just like you have described. However, I don't recommend including redundant fields, because searching and filtering based on these redundant fields will be difficult. For instance, if Faculty and Students both have a field with a name like "Address", then there will be two "Address" custom search filters in a View of Profiles. Instead, if you consolidate to a single post type, you should eliminate any redundant fields.
If you want to show and hide specific fields for different types of Profiles, you can try out our data-dependent fields.
See attached screenshots. visible field groups.png shows the field groups that are visible on the Add New Profile page, and the other shows the Screen Options on the Add New Profile page.
It's possible that the page isn't loaded completely because of a lack of memory, but it's difficult for me to tell. I have access to the wp-admin area from another ticket, but I'm not able to see the Profile post type. Was it deleted?
Christian,
Thanks for your response. I was not aware of data-dependent fields. They sound promising. My next question is much more consultative in nature and may be beyond the scope of Toolset support, but here it is: I'm building out a website for a graduate program at an art school, and I've created three custom posts...
+ Alumni Profile
+ Student Profile
+ Faculty Profile
The three post types have many fields in common and a few that are unique. At the risk of providing too little information about what the website's needs are, do you think it's better to create one post type (such as a generic "Profile") and use the data-dependent fields you mentioned or three separate post types (as I've done)? Again, I realize there may be too little information to inform your response.
Regarding the Profile custom post type not being visible in my public instance of WordPress, it wasn't deleted. As the older screenshots reveal, and which I forgot to mention, I created the Profile post type on a local / development instance of the site. Apologies for the confusion. But I don't think we need to spend any more time on this. It sounds like data-dependent fields are the way to go (unless you say otherwise). Could you point me to where I can learn more about them? I searched the documentation on the Toolset website but nothing came up (!).
Thanks!
do you think it's better to create one post type (such as a generic "Profile") and use the data-dependent fields you mentioned or three separate post types
Organizing these via Post types or via a custom field or via a specific taxonomy designation is mostly arbitrary depending on how you want to present your site's information. The main reasons I can think of to use separate post types:
- They have separate archives, URL directories, and feeds. At /alumni, /student, and /faculty, WordPress will set up automatic archives for you when these are separate post types. If they are a single post type, these archive URLs will not exist and you will have to create a custom Page that includes a filtered View that behaves like an archive at each of these URLs. The posts will also be found at the /profile archive.
- If you want to include a custom search View, and you want to show all 3 post types in the results, sorted by post type. This can be more difficult if all 3 are together in a single post type.
- If you want to establish relationships between these posts. For example, if you want to link Students and Faculty members somehow, like an advisor relationship for example, two separate post types would be preferable because you can use M2M relationships.
It sounds like data-dependent fields are the way to go
Here's a document about these types of conditional field groups:
https://toolset.com/documentation/user-guides/types-custom-fields-conditional-display/
Christian,
Thank you for your very thoughtful response. In these types of situations, decisions are made based on a limited understanding and sometimes need to be revisited based on future experiences and needs.
That said, based on your input I think my plan is to create two post types:
+ Faculty. This post type exists, and it and its custom fields will remain unchanged.
+ Students. This post type will have three field groups: basic info, alumni fields, and current student fields. Using the data-dependent approach you mentioned and a status radio button to toggle alumni or current student, the appropriate fields will display. This will also make it easier to "transition" current students to alumni status.
This approach does have some issue. I'll need to make two pseudo-archive pages for current students and alumni, but that's trivial. There is also a strange case of a faculty member who is also an alumna of the program, but that's an exception.
Any thoughts on this plan before I plow ahead?
Thank you for helping me think this through!