How-to? Single relationship with 3 metaboxes for 3 sets of query vars

Support MB Relationships How-to? Single relationship with 3 metaboxes for 3 sets of query vars

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42615
    Michael KernMichael Kern
    Participant

    I have two CPTS, one with taxonomies. Slugs provided below:

    1. CPT: 'services'
      • Taxonomy: 'service-type'
      • Term: 'modalities'
      • Term: 'concentrations'
      • Term: 'populations'
    2. CPT: 'therapists'
    3. Relationship: 'therapist-to-service'

    I want to apply multiple 'service-type' terms to any one of my Services posts, and have an admin column/metabox for each term slug without having to create a new relationship for each set of query args.

    Is there a way to do this?

    Example:

    I have a 'services' post titled "Adults", and its terms include 'concentrations' AND 'populations' (since it can logically fall under either one).

    When I connect "Adults" to a therapist named "John Smith," I want to be able to see it in two metabox columns titled "Concentrations" AND "Populations."

    I tried creating a separate relationship (same CPT connections) for each set of query args (one for each term in 'service-type') + an overarching version of the relationship with no query args whatsoever. Then I used one of the relationship fields to link "John Smith" ('therapist') to "Adults" ('services' CPT with 'concentrations' and 'populations' terms).

    My thought was that the terms are stored in post meta, not as data. Therefore, when I use any one of the relationships to link the two posts, the corresponding term should populate in the "Concentrations" AND "Populations" metaboxes in the edit screen for "John Smith." Unfortunately, that's not the case.

    Is there a way to achieve this in a way that perhaps a single relationship (single source of truth for connections) can have multiple metaboxes/admin columns with query args applied to each for filtering?

    I hope what I'm asking makes sense.

    #42625
    PeterPeter
    Moderator

    Hello,

    So I understand you want to display the admin column for each service-type term when a service is related to a therapist in the post list table of the CPT therapist.
    It's not possible with the current settings of MB Admin Columns and MB Relationships. You can try to create a custom admin column by following the documentation https://docs.metabox.io/extensions/mb-admin-columns/#custom-admin-columns

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.