• Resolved cjmclean

    (@cjmclean)


    I started this topic in a previous topic which seems to have been resolved yet I’m still confused as to how to achieve it.

    I’ve been advised to use a link table. How do you create a link table exactly? The documentation on this particular subject is rather limiting …

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @cjmclean

    For reference, link to the prev topic: https://www.ads-software.com/support/topic/isolated-third-relationship/

    I closed that topic since I mentioned anything there is to mention about a link-table.

    See it like this.

    A link-table is just a separate table solely for the relationships to be linked together.
    Let’s call the link a “Participant” for this example.
    So the participant would be a private Pod with only two relationship fields to the Actor and a Role. This could be an advanced content type with an actual separate table outside the WordPress ecosystem. Since there is no other purpose for this Pod we don’t need to do anything else with it.

    The Project Pod can now have one relationship field to the Participant Pod.
    With that link you’ll have a link to a combined relationship to an Actor AND Role.
    You could even enhance the whole participant Pod with more data about this participant, like in your case, what seasons etc.

    This is the only way to properly create a relationship like you want.

    Keep in mind though, this is advanced usage of Pods and may require some experience with database structures to understand.

    Cheers, Jory

    Thread Starter cjmclean

    (@cjmclean)

    Ah, I understand now!

    Before I go, in order to achieve what I need in the frontend, how would I display this in the Project template? Also how would I link the Actor to the corrosponding pod post?

    • This reply was modified 4 years ago by cjmclean. Reason: Supporting request question
    • This reply was modified 4 years ago by cjmclean.
    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @cjmclean

    Short magic tag example for Pod Templates:

    A Project template:

    
    [each PARTICIPANT_REL_FIELD_NAME]
    Actor: {@ACTOR_REL_FIELD_NAME.any_actor_field}
    Role: {@ROLE_REL_FIELD_NAME.any_role_field}
    [each]
    

    Please see this page and it’s introduction video’s for more info about how Pods works:
    https://docs.pods.io/faqs/what-can-you-build-with-pods/

    If you want to go the PHP route you can use WP_Query and it’s meta query functionality to query for the relational data.

    Cheers, Jory

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