Custom Fields
Re-Envisioned
Support MB Relationships Linking CPTs together

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 10 months, 3 weeks ago.

  • Creator
    Topic
  • #12459
    Resolved
    @mindspark
    Participant

    Hi Anh –

    I’ve successfully set up a couple of CPTs and have the ability to link them on the backend – see here:

    https://snag.gy/NmIv0p.jpg

    The goal of this website is to create records that can later be updated – think of it as a sales pipeline project – like Pipedrive or similiar.

    What isn’t clear to me is how to identify linked records so I can either display them or update them using Frontend Submission.

    Example –

    CPTs:

    • Deals
    • Packages
    • Activities
    • People (Buyers and Sellers)

    Custom Field Groups:

    • Deal Info
    • Package Info
    • Activities

    The way the flow works is like this:

    First Deals are created. These are preliminary records. Ideally, all deals turn into sales, but it is possible that deals never advance beyond this initial step. Deals move through many steps before they can be completed.

    Second, once a Deal reaches a certain Status, then a Deal triggers a Package. The Package is a complete set of info needed for buyers to decide to purchase something. Package details are many and complex and use most of the different field types in the MB Builder.

    The sales cycle can be long – so over time employees continuously work the deals/packages and update the record with Activities. All Deals/Packages will have something recorded in Activities, but some will have more than others.

    In terms of Relationships – everything is One to One except for People. That’s becuase people can be either a buyer or a seller and can make more than one puchase. It looks something like this:

    https://snag.gy/NQdCBf.jpg

    So really I need to know:

    1. can CPTs be linked from the front-end? if how which form field do I use?
    2. after linking the CPTs together (Deals, Packages, Activities, and People) and create a complete record, how would I display a given CPT and then also all connected CPTs?
Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #12486

    Anh Tran
    Keymaster

    Hi Neil,

    The MB Relationships extension automatically creates 2 meta boxes for 2 sides of each relationship with these IDs:

    • {$relationship_id}_relationships_from
    • {$relationship_id}_relationships_to

    So you might need to use these IDs to include into the front-end forms to let users select a post/user to make a connection.

    To display connected items in the front end, you need to code a little bit. The code is provided in the docs. As you’re using Beaver Builder, I’d suggest creating a shortcode to display related items, then insert the shortcode into a text module.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.