• Resolved madmikefrog

    (@madmikefrog)


    Hi

    Can anyone point me in the right direction. I get set up a pod, display all the fields, but when I try a relationship between a post and (Taxonomy). I can’t figure out to display the “related” fields. I have tried $pods->get_field (‘houses.garden’) which is my related field. The demo video is great, but just I need an example code in version 2. I tried to figure from the early pod 1.x examples. but not getting anywhere. Any help is gratefully received

    http://wordpress.org/extend/plugins/pods/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)


    Please provide a little more information:

    • Post Type name
    • Taxonomy name
    • Relationship name on Post Type, that relates to taxonomy
    • Is this a relationship field, or are you using the built in taxonomy functionality?

    Hi,

    Label, Name,Object type,storage type
    houses, houses, Custom Post type, Meta
    typegardens ,typegardens,Custom Taxonomy,Table

    houses
    Label Label Name Field Types
    field1 home Plain Text
    field2 garden Relationship [type: pick] typegardens (Taxonomy)

    typegardens
    Label Label Name Field Types

    field1 gardentype Plain Text
    garden desc garden_desc Plain

    POD Page
    Page code
    <?php
    $pods = new Pods(‘houses’);
    $pods->findRecords(‘name ASC’, 25);

    while ($pods->fetchRecord()) {
    echo $pods->get_field(‘home’);
    echo $pods->get_field(‘garden’);
    echo $pods->get_field( ‘typegardens.gardentype’ );
    echo $pods->get_field( ‘typegardens.garden_desc’ );
    }

    Values in houses is;

    field1 (field1ofhouse)
    field2 drop down (typeofgarden1)

    value in gardentype is
    Name (typegardenfield1)

    field1 (field1gardentype)
    garden desc (field2gardendesc)
    field2

    Screen output is

    (field1ofhouse)ArrayArrayArray
    ?>
    precode

    <?php
    global $pods;
    if (empty($pods->data)) {
    $pods = 404; // Show standard WP 404 page if the item doesn’t exist
    }
    $pods = new Pod(‘houses’);

    ?>

    Hopefully that give you the information you need.

    regards

    Mike

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)


    $garden = $pods->field( 'garden' );

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)


    You’ll also want to be sure you use PHP to loop through the array to output.

    Or you can use this and it will automatically output a list comma-separated for you:

    echo $pods->display( 'garden' );

    That’s help me out very nicely. Thanks for your time.

    Mike

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘releaship between pods’ is closed to new replies.