Is it possible to create relational metabox values in a custom post?

I have a custom post type ('Model') for a sports modelling agency, and it requires the model to enter sports they are competent at, and also rank their ability from 1 to 5. For example, given the information:

Model: Joe Soap.
Football: 4.
Archery: 2

Read More

I would store this in the custom_post_type 'model' with the fields:

Model Name: Joe Soap.
Sports: Football, Archery (taxonomy).
Rank: 4, 2.

How do I associate 4 with Football and 2 with Archery using a metabox, where different models may have different sports in their lists ?

Related posts

Leave a Reply

3 comments

  1. Your question is focusing on the wrong thing. A metabox is just one way for a user to introduce some data. The more important question is how you should store that data in the database.

    You could make ‘sport’ a custom post type and connect it to models using the Posts 2 Posts plugin. Then, for each connection, you can associate a ‘rank’ custom field:

    https://github.com/scribu/wp-posts-to-posts/wiki/Connection-information

    The plugin takes care of creating a metabox and of storing the values in an efficient manner.