Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Fields for MB Relationships #69

Open
efc opened this issue Mar 18, 2023 · 0 comments
Open

Custom Fields for MB Relationships #69

efc opened this issue Mar 18, 2023 · 0 comments

Comments

@efc
Copy link

efc commented Mar 18, 2023

For one of our projects we need to have custom fields associated with the relationship itself rather than with the records to or from the relationship. In the past we have used Toolset, which accommodates custom meta for relationships, but MB Relationships seems to be missing this concept. Before we spend time developing this for ourselves, I wanted to check and see if there is a solution already available, or if such functionality is on the roadmap for MB Relationships.

Here is an example of how custom fields for relationships can be helpful. Let's imagine a site that tracks movies. It has a custom post type called movie which holds information about each film, and another custom post type called people which holds information about people in the film industry. We use MB Relationships to create a people-movie relationship. Anyone who worked on a particular film is related to that movie.

But what if we want to record their role on a particular movie. Were they an actor or director? Were they credited in the film, or was their participation uncredited? If they were an actor, what role did they play? This information is not really about the movie or the person, it is about the nature of their relationship.

In MB terms, we would like to construct a set of custom fields that would be relevant to the relationship. One might be called job and would be a select field with options like "Actor", "Director", "Gaffer", "Producer", and so on. Another might be a plain text field called role which would be conditional on the job being an actor and would let us fill in the role the actor played in this film. And finally we could have a checkbox called credited which would record whether this relationship was included in the film's credits.

Again, in MB terms, we would like to assign this custom field set to the specific people-movie relationship, so that every time we assign a new relationship, we are also asked to fill in these custom fields about the nature of the relationship. An then, when retrieving the relationship later in our code, we could also easily retrieve the value of these custom fields associated with the particular relationship record we are dealing with.

I hope that gives you an idea of what we need and what is missing from the current MB Relationships.

Is anything like this planned for MB Relationships? Is there any way we can be helpful in building it?

Do you have any suggestion for tools or approaches to create something like this alongside MB Relationships as it exists today? We'd love any thoughts on how best to implement something like this, since we will need it in place by this summer and I doubt MB Relationships will add anything like this before then.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant