• Resolved wpress2010

    (@wpress2010)


    I have a Pod (let’s call it “Old”) with about 20 fields. I want to add 3 fields that will pull their contents from another Pod.

    For the sake of brevity, let’s call the 3 new fields Name, Rank and Serialnumber. They are in a Pod called New.

    To add the first field, Name, I created a new field in the existing “Old” Pod, also called it Name, and in the Relationship, picked Related To as “New”. When called in a template, this works, and I see the contents of the field “Name” that are stored in the New Pod. The New Pod is a Custom Post Type.

    I add another field called Rank, also do the same thing: but the Related To dropdown only lets me pick the Pod “New”, not any specific field in that Pod. In the template, {@rank} also displays the contents of the field Name.

    I am sure this is pretty simple, but I just don’t get it. How do you specify WHAT field in a Relationship type field to link to? I thought it just involved naming the two fields the same.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jim True

    (@jimtrue)

    Relationships don’t work against ‘specific fields’. You’re creating a relationship to the post on the other side of the relationship, not to the ‘field.

    If you want to show the contents of another post that is related to ‘Old’, you’ll create the relationship to the other post, let’s call that field ‘Related_New’ and you’ll reference the rank, name and serial number as:

    related_new.rank
    related_new.name
    related_new.serial_number

    Check out the following video for a primer on how Pods relationship fields work:
    https://docs.pods.io/videos/grow-beyond-posts-pages-introduction-pods-framework/

    • This reply was modified 4 years, 10 months ago by Jim True.
    Thread Starter wpress2010

    (@wpress2010)

    Thanks, Jim. I watched the video, but it doesn’t explicitly discuss the kind of information linking you’re outlined for me here. I wrote it into the Pod, and it works as expected. It was especially helpful to be able migrate the new Pod and template I built to the live site with just a few clicks.

    Plugin Author Jim True

    (@jimtrue)

    We tend to focus on Multiple select, because it uses the each loop to loop through that relationship connection and is clearer in referencing than the single select.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Relationships’ is closed to new replies.