• Resolved kheiberg

    (@kheiberg)


    Hi,
    Can I find and then display a pod (Dealer) after a Gravity Form submission. The find needs to find the pod based on the postal code field from Gravity. The postal codes are stored in a custom taxonomy called dealer_territory. I am pretty sure that can be done with the pods short code. Let me know if that is the right direction…

    Then if the pod is not found I need to show a “default” dealer pod. I think I could do that via the pods templates with the [if][else][/if] in the template. But I am not sure I am looking in the right direction. Can a pods template be passed a param? Like the postal code?

    I can create a custom confirmation or redirect to another page in Gravity…

    Thanks, Kris.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jim True

    (@jimtrue)

    You can’t use if/else/if in a Pods Template to show ’empty’ items. If the shortcode passes empty items, it’s just an empty loop and nothing shows. if/else/if only works on fields being empty.

    As to the shortcode, yes, you could easily pass a parameter sent from a search form into the shortcode with:

    [pods name="dealer" template="Dealer List" where="dealer_terrify.slug like '{@get.zipcode}'"]

    You will need to activate Special Magic Tags as the {@get.any} is not available otherwise.

    How to use Special Magic Tags: https://docs.pods.io/displaying-pods/magic-tags/special-magic-tags/ Please pay attention to where these can be used and the wp-config.php change you have to make to be able to use them.

    Thread Starter kheiberg

    (@kheiberg)

    Hi Jim,
    Thanks much for the response.

    I came up with a solution by using Custom Content Shortcodes plugin with the Pods short code. It has a “exists” param on it’s loop shortcode that is similar to the pods code. Use that in combo with the CCS “If empty” code and it allowed me to do the empty logic. It is sort of a kludge but got the job done.

    The drawbacks are an extra query and the extra plugin to get it done. I would guess the better solution would be to add a new custom post template and do the logic in PHP.

    Have a great weekend!
    Kris

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Find pod and show after gravity form submission’ is closed to new replies.