black friday sale

Custom Fields
Re-Envisioned
Support MB Relationships Nested Relationship

  • Creator
    Topic
  • #22793
    Resolved Trang Nguyen
    Participant

    Hi! I have 2 questions related to MB Relationships. Please spend some minute to take a look:

    1. Is it possible to show a nested relationship?
    For example, I have 4 post types:
    – continent
    – country
    – city
    – attraction

    I create 3 relationships:
    – continent_to_country
    – country_to_city
    – city_to_attraction

    I create posts Asia (continent), Vietnam (country), Hanoi (city), Hoan Kiem Lake (attraction), and assign relationships between them.

    On Hoan Kiem Lake post, I could show Hanoi without a problem as in the document https://docs.metabox.io/extensions/mb-relationships/#multiple-relationships.

    I wonder could I show also the relationships of Hanoi with Vietnam and Vietnam with Asia on Hoan Kiem Lake post? Something as “Asia > Vietnam > Hanoi”.

    2.How to limit the number of connections? As an attraction can be assigned to 1 city only.

    Thank you in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #22797
    Long Nguyen
    Moderator

    Hi,

    1. The extension MB Relationships helps you to create relationships (connections) between posts, terms, and users in a flat connection, not a hierarchical or nested connection.
    2. I think you can use the CPT and taxonomies with the hierarchy to easily select on the backend and query to show on the front end.

    3. To limit the number of connections, please use the field setting max_clone. Follow this documentation for more information https://docs.metabox.io/extensions/mb-relationships/#syntax.
    #22800
    Trang Nguyen
    Participant

    Many thanks for your help, Long!

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