• Resolved noellarkin

    (@noellarkin)


    So here’s an excerpt from my pod template. It’s for a pod called “job-vacancy” and has a relationship field called prescreened user that is bidirectionally linked with the user (extended) pod.

    [each prescreeneduser]
    <h3>{@user_nicename}</h3>
    <div>
    <a href="http://localhost/site/author/{@user_login}">
    <button>View User</button>
    </a>
    </div>

    <form method="post">
    <input type="hidden" name="user_id" value="{@ID}">
    <input type="hidden" name="job_vacancy_id" value="{@t.ID}">
    <button type="submit" name="update_user_pod">Shortlist User</button>
    </form>

    [/each]

    I know that in this line <input type="hidden" name="user_id" value="{@ID}"> the tag {@ID} gives me the related user’s ID, since I’m inside the each loop. But in the next line, I want to get the ID of the job-vacancy post. Outside the each loop I can get it using {@ID} but I’ve tried every combination to get it inside the loop, and can’t – – {@t.ID}, {@d.ID} etc. How do I get the post_id that’s outside the loop?

Viewing 2 replies - 1 through 2 (of 2 total)
  • flexjoly

    (@flexjoly)

    What is the name of the bidirectional field in the user-object?
    You can use that to link back to the job.

    If the field is: user.linkedjob then
    {@linkedjob.ID}

    If you use pods template, it should also give you a list of possible fields/tags you can use. If you selected the pod that is used in the template.

    Plugin Support Paul Clark

    (@pdclark)

    {@post_id}

    Requires define( 'PODS_SHORTCODE_ALLOW_EVALUATE_TAGS', true ); be set in wp-config.php

    See https://docs.pods.io/displaying-pods/magic-tags/special-magic-tags/

    Also, http://localhost/site/author/{@user_login} can be /site/author/{@user_login} to avoid needing the change the URL

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.