MB Relationships in Elementor PRO

Support MB Elementor Integrator MB Relationships in Elementor PROResolved

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #30318
    DANIEL FITIPALDO R.DANIEL FITIPALDO R.
    Participant

    Hi,

    I've cretaded a custom post type Expert, and a 1:N relationship Experts (1) -> Posts (N). Experts is the post type parent (From) and Posts the post type child (To) of the relationship.
    I've added some custom fields (such as Name and Age) to Experts post type using Metabox plugin. I am using Elementor PRO for designing the single post template for Posts and I want to include the values of the Expert parent custom fields (Name, Age) related to the particular Post in the Posts template.
    I know how to refer to the Post custom fields from Elementor PRO using Dynamics Tags and selecting Meta Box field but I don't know how to refer to the values of the parent Expert post type.
    How can I do that? Is it possible?
    Thanks

    #30320
    Long NguyenLong Nguyen
    Moderator

    Hi Daniel,

    It's not possible to show the custom field value of a related post in Elementor. You need to create your own shortcode get it and add the shortcode to the builder.

    #30327
    DANIEL FITIPALDO R.DANIEL FITIPALDO R.
    Participant

    Ok, thanks for the shortcode tip!
    Do you have any basic example of a snippet with this functionality to share?
    thanks again.

    #30436
    DANIEL FITIPALDO R.DANIEL FITIPALDO R.
    Participant

    You can close this ticket as resolved.
    The API attached works fine!!!

    $pages = MB_Relationships_API::get_connected( [
    'id' => 'posts_to_pages',
    'from' => get_the_ID(),
    ] );
    foreach ( $pages as $p ) {
    echo $p->post_title;
    }

    https://docs.metabox.io/extensions/mb-relationships/

    #30821
    LarryLarry
    Participant

    -

    #30822
    LarryLarry
    Participant

    Hi - What would such a shortcode look like?? I'm trying to get Elementor to pull data from a relationship post into the color picker field. Thank you @longnguyen

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