• Resolved flaviomaldonado

    (@flaviomaldonado)


    Hi,

    I have a problem I think it’s simple to solve, but I’m trying to do this for hours!

    I have two PODS (Custom Post Type): Modules and Tutorials.

    In Tutorials, I have a relationed field to Modules.

    Each Tutorial must have a Module.

    After that, I need to LIST it separating by Modules.

    Example:

    Module 1
    – Tutorial 1
    – Tutorial 2
    Module 2
    – Tutorial 3
    – Tutorial 4
    – Tutorial 5

    Exact like this.

    I tried to use a PODS template, but it doesn’t work for me.

    Should be something like this:

    <nav>
        <ul>
            [each module]
            <li>{@module.post_title}
                  <ul>
                       [each tutorial]
                       <li><a href="">{@tutorial.post_title}</a></li>
                       [/each]
                  </ul>
            </li>
            [/each]
        </ul>
    </nav>

    The code above it’s an exemple. Should be simple. But I’m not knowing how to solve this with PODS + Templates.

    I hope it’s clear what my problem is.

    Can anyone help me?

    Thanks a lot!

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

    (@keraweb)

    Hi @flaviomaldonado

    Did you make this a bi-directional field from Modules to Tutorials as well?

    Besides that. Each only works for object fields. In your case I think you need a Pods shortcode:

    [pods type="module" template="your pods template"]

    This will loop through all existing modules and will create the structure you’ve defined in your template.

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

    Cheers, Jory

Viewing 1 replies (of 1 total)
  • The topic ‘PODS NAV Menu’ is closed to new replies.