"Post" Field Type

Support Meta Box AIO "Post" Field TypeResolved

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #41474
    richard rowlesrichard rowles
    Participant

    Hi, I have Twwo CPTs A and B. A has a field of type "post" that lists all the posts of type B I would like to list in the select box a field in CPT-B that is not the title. Is this possible? Sorry I couldn't find out how to do this.

    TIA Rich

    #41481
    PeterPeter
    Moderator

    Hello Rich,

    Sorry, I don't understand the question clearly. Can you please give more details or share some screenshots of this?

    #41484
    richard rowlesrichard rowles
    Participant

    Not at PC right now, but

    1) when you add a Field to a field group one option is to use the "Type" of "Post"
    2) then in the "Post Types" box I can add the post type that I want to be used.
    3) for "field type" I choose "select".

    So in this drop down I have a list of posts of the type i have choosen, which is absolutley correct.

    The issue is that it only displays the post titles in the select box. What I need to do is to have different field displayed in the box.

    I was thinking I might be able to use "query args" to specify which field and value I retrieve to display in the box but I can't get it to work.

    I this example I'm not using title at all. So from the CPT called "contact" I need the "name" field from that CPT to list in the box.

    Does that make sense?
    Thanks Rich.

    #41497
    PeterPeter
    Moderator

    Hello,

    I understand the question. Unfortunately, Meta Box does not support displaying other field values in the select box, only the post (object) title will be displayed.

    #41498
    richard rowlesrichard rowles
    Participant

    Thanks Peter, Is there a way with metabox or a component it works with to copy one field to another either before a new/edit submit button is pressed that way I could copy the "name" field to the CPT Title?

    Best
    Rich

    #41499
    richard rowlesrichard rowles
    Participant

    Solution Found: Quite usefull maybe?

    Using "Adminify" I added this code to the footer

    1) It hides the title and slug for the post.
    2) it copies from the required field to the title input box.

    NB: I will add page name based if statment to only activate on the correct page.

    RESULT: "post select dropdown" now has the value of a field I need to display in the dropdown. 🙂

    document.getElementById('post-body-content').style.height=0;
    document.getElementById('post-body-content').style.padding=0;
    document.getElementById('post-body-content').style.margin=0;

    document.getElementById('name').addEventListener('keyup', function (event) { document.getElementById('title').value = event.target.value});

    Best Rich

    #41508
    PeterPeter
    Moderator

    Thank you for sharing the solution.

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