• Resolved boblebad

    (@boblebad)


    Hello

    I’m wondering about the new way you docs layout the workings of relationships:
    “`1: Recipe ingredients
    A recipe with multiple ingredients will need some context to those ingredients like the amount.

    Main Pod: “recipe”
    Child Pod: “ingredient”
    Link Pod: “ingredient_amount”

    The Link Pod “ingredient_amount” will only have two fields: “rel_ingredient”, the single relationship field to the ingredient Pod and “amount” for how much of this ingredient is needed.
    The main Pod “recipe” has a multiple relationship field “rel_ingredient_amount” to the link Pod “ingredient_amount”.`”

    Is this the best way to do it, making a third pod to take care of this ?

    I have a Pod called Articles. Articles have Authors, which has its own Pod. It’s setup the “old” way where there’s a relational field in Articles for Authors, vice versa.

    Or is the example from the new docs for a different scenario ?

    All the best
    Carsten

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

    (@keraweb)

    Hi @boblebad

    Currently this is indeed the best way to implement field groups.
    We have planned to support this natively in Pods 3.0 but this will take a while!

    https://docs.pods.io/advanced-topics/using-link-tables-for-multi-field-relationships/

    Cheers, Jory

    Thread Starter boblebad

    (@boblebad)

    Thank you @keraweb

    So you’re advising me to change to this from the old form, where i just have a field in my Article pod “related_author” that connects to “author” in my Authors pod – and vice versa “related_article” which connects to “article” in my Article pod ?

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @boblebad

    No I merely mentioned that the way you suggested yourself was correct ?? (Using a “Link Pods”)
    The documentation I posted is the current solution and is the same as you suggested.

    Cheers, Jory

    Thread Starter boblebad

    (@boblebad)

    Hi again @keraweb

    Hmm, i thought i tried to be clear what was what ??

    You advice me to do it the link way ?

    The old way as i descibed, which i have,

    “my Article pod “related_author” that connects to “author” in my Authors pod – and vice versa “related_article” which connects to “article” in my Article pod ?”

    is not as good.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @boblebad

    Well it totally depends on what you need for your project.
    If a single relationship to the author is sufficient then that is indeed best.
    But if you need extra context in the author relationship then you’ll need a link table/pod.

    So in your original question you asked for the ingredient. In case of an ingredient you’ll indeed need to specify the amount. In that case a link table with two fields (relationship and number) will be required.

    Cheers, Jory

    Thread Starter boblebad

    (@boblebad)

    Thank you for clarifying @keraweb

    I’ll keep it as it is. It’s only Articles and Authors ??

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @boblebad

    Ah ok, no problem!

    Cheers, Jory

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Relationship question’ is closed to new replies.