Scenario:
Post type - Member
Post type - Group
Currently set up in a many-to-many relationship. A member can belong to many groups. A group can have any number of members.
I have a form so that a user can create their Member post type. But I'd also like them to select from all the available Groups. This seemed a lot more straightforward when it was just a parent/child relationship.
Am I missing the option within the post form creation?
I'd also like to attach a year to a member's time within a group. So like: Bob Smith --> Fun Group during the 2023 year. Should that be a taxonomy or custom field on one (or both) of the post types? Because then they could belong to a totally different group in 2024 (or even many).
I'm fine doing this with separate forms if necessary. One to create the Member and then another to establish the relationship with the Group (and the year).
Those resources don't address how to add these items to a cred form.
In a typical parent--child relationship, there are options (or at least there used to be) to set the related post type in a form. How can I go about doing that for the scenario I've described above?
And do I need a relationship form to set the intermediary post field separately? Or can I do it using the same form as the one that sets the Member--Group relationship?
If you have actual use case - please share details where you want to add relationship form and what field you want to edit and what is your expected result.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Can you please share details on what page/post you added the form "Member Intake" - also once the new member (user) created using this form to what group you want to connect - what is the post relationship you want to use?
Is there any post-relationship custom field (intermediary post custom field) with your many-to-many?
If you can share bit more details and step by step information about what you want to achieve and where the things located that will help me to guide you in the right direction.
I have set the next reply to private which means only you and I have access to it.
I'd like it to be a many to many relationship.
A member can belong to multiple groups, as well as belonging to them at different points in time. That's why I'd like the "Years" field used to establish what year the member was a part of that particular group.
So someone could be:
Bob Smith --> Fun Group (2023)
Bob Smith --> Boring Group (2024)
But all the rest of Bob Smith's information would be the same. They could just periodically add an additional relationship down the line (though I'd still like them to establish one on this initial form).
When you create post-relationship form it will allow you to select the year field that is the intermediary post type field.
So I've created the following relatioinship form for your post relationship between members and entities:
- lien caché
As you can see the field Years for Entities is available.
Now, question is where you want to add the relationship form on what page or post?
- Do you want to allow user to connect new post in many to many or only edit the relationship?
- When you say:
I am attempting to use the form called "Member Intake" to create a user's singular Member post as well as connecting it to an existing group (if possible). If that needs to be a different form (where they can only select their own Member, not someone else's),
===>
As we have different relationship form to if you edit the relationship form:
- lien caché
And click on Members or Entities field, it offers you the option with "Filtering" section where you can select you want to display posts for those fields with any author or current author.
I have created a page called "Link-Group" that has the post relationship form you made. But it doesn't seem to work properly.
I want the user to be able to link their own Member (one authored by the logged in user) with any Entity. So they can use the form many times. So I suppose that might be one-to-many form their perspective.
With relationship form - by default when the above page loaded with member dropdown do you want to select any member by default? or user should select member from the list of the member dropdown?
and same as what you would like to show with entities dropdown?
It should be the one authored by the currently logged in user. So if you create one, it should select that one only.
I'll have something in the backend to prevent them from creating a second, so it shouldn't be a problem to select the only one authored by the currently logged in user.
I've set the post author of the following post "Test Person" as "toolsetadmin":
- lien caché
Then I've created the following legacy view to get the post ID of the member post where current loggedin user is the author of that member post:
=> lien caché
Where as you can see I've added the following "Query Filter":
Post author filter
Select posts with the author the same as the current logged in user.
The above view will only return 1 entry (the return value will be the ID of member post) if such post is found otherwise 0.