• Resolved raulmagdalena

    (@raulmagdalena)


    Hello
    i have a tipical book->author relationship where more than one authors are related to a one book. Relationship works fine, in the add new book form i can add several authors and they are saved right, but when i try to show it by a template like [each author] “code for show it” [/each] nothing is shown
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Paul Clark

    (@pdclark)

    In testing, Pods does not allow me to create a field named author because it is reserved for internal WordPress usage.

    Have you used a different name for the field?
    What is the full content of your template and shortcode?
    Is the authors field a relationship to a post type, or to users?

    Assuming you can rename the field to book_authors, and the relationship is to users, and your template is being displayed on a book singular template, configuration might look like this:

    Shortcode:
    [pods template="book_authors"][/pods]

    See https://docs.pods.io/displaying-pods/pods-shortcode/

    Template book_authors:

    [each book_author]
    	{@display_name}<br/>
    [/each]

    See https://docs.pods.io/displaying-pods/template-tags/each-loop-tag/

    Thread Starter raulmagdalena

    (@raulmagdalena)

    Hello

    thanks, the error was mine, i was not placing the “each” at the right place.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Feching several record from a relationship’ is closed to new replies.