Custom Fields
Re-Envisioned
Support MB Relationships Display related cpt permalink

  • Creator
    Topic
  • #22985
    Resolved Eliodata
    Participant

    Hi,
    I am using bi-directional relationship between 2 custom post types. I followed these advices:

    https://docs.metabox.io/extensions/mb-relationships/#sibling-items

    Works great.

    But I would like the related cpt to be clickable. Please, how to display the related cpt link and open it into a new tab?

    Sorry for my poor english!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #22989
    Eliodata
    Participant

    Edit: I am using bi-directional relationship between users and custom post types!

    Thank you

    #22990
    Long Nguyen
    Moderator

    Hi,

    In the loop, you can use the function the_permalink() to display the link to the post. See the example code https://docs.metabox.io/extensions/mb-relationships/#posts.

    And to open the link in a new tab, you can add the attribute target="_blank" to the <a> tag .

    <a href="<?php the_permalink(); ?>" target="_blank"><?php the_title(); ?></a>

    #22993
    Eliodata
    Participant

    Thank you for the very quick answer! I don’t want to display the link on front end, but on the edit post / user relationship metabox.
    Maybe I didn’t understood your answer, I am not a dev, sorry. And I would understood if this this question is beyond the scope of your support.

    #22996
    Long Nguyen
    Moderator

    Hi,

    The plugin MB Relationships has not supported to link to the post selected on the backend yet. I’m going to create a feature request for the developer team to support this case.

    Thank you.

    #22999
    Eliodata
    Participant

    OK. I guess is the same for my other post related to metabox relationship custom fields.
    FYI pods relationship feature adds a simple edit link near to the related items once selected. A similar solution would be nice.

    Best regards

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