Relationships variables?

Support MB Relationships Relationships variables?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29875
    team@novify.pt[email protected]
    Participant

    Maybe my challenge can be easily solved with other methods, but is it possible to have parameters (custom fields) on a relationship instance?

    The challenge: two CPT (authors and publications). I'd like to give the authors the ability to handpick a couple of "publications highlights" that will be featured on their personal "frontend Single Page".
    The challenge here is that a publication will have several authors, and it may be a "highlight" for some of its authors but not all.

    Hence, I imagined that the relationship between an author and a publication would have the "highlight" custom field. Is this possible?

    Or would it be better to have a custom field on the user that would allow to search internally for a given publication and insert its ID into that user repeatable custom field?

    Thank you for your expertise.

    #29880
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I think you can create a custom taxonomy highlight for each CPT. Using the custom taxonomy will get posts faster than the custom field, please read more here.

    Then you can use the setting query_args when creating the relationship to show the highlight posts on the select box only.
    Get more details on the documentation https://docs.metabox.io/extensions/mb-relationships/#syntax

    #29890
    team@novify.pt[email protected]
    Participant

    Hi Long. Thank you for the suggestion. I have a question regarding your suggestion.

    Then you can use the setting query_args when creating the relationship to show the highlight posts on the select box only.

    This would require first to add the term "highlight" to the publication that the user wants to target (to appear on the select box), and then add the relationship in the user profile, right?

    It would also require two relationships between the users and CPT publications right? One that is a "normal" relationship, and another one that is the "highlighted" relationship as you described.

    Hope I'm not doing any big confusion here.

    #29912
    Long NguyenLong Nguyen
    Moderator

    Hi,

    We need only one relationship between Author and Publication.

    1. Assign some publication posts to the term highlight
    2. Use the setting query_args when creating the relationship to show the publications that have the term highlight on the select box.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.