• Hello,

    first I would like to thank the creator of this plugin for the amazing work that has been done ! I’m really pleased to find such a usefull plugin.

    I’m using it with the “Pods extension”, to create forms for new pod entries. Each user can create attributes in the database (as custom post type), and I’d like to create a form for users to add articles and give them an attribute, BUT only among the attributes they have created.

    For example,
    if userA has created attributeA1 and attributeA
    if userB has created attributeB1 and attributeB2
    When userA opens the form, the dropdeown should show only “attributeA1, attributeA2”

    I think it can be done using a WHERE condition, and linking attribute’s field to form’s field (each attribute has a field with creator’s id, and the user id is in an hidden field of my form)

    Is it something that can be done ?
    Thanks a lot for your response !

    SilverSmarty

    https://www.ads-software.com/plugins/caldera-forms/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor David Cramer

    (@desertsnowman)

    The only thing I can think of is to have some form of filter for relational fields.

    I’ll explore more into it and let you know. right now, I cant think of an easy way to do that.

    I made something similar for a project I’m working on using CF!

    https://github.com/thely/wtsscheduling/tree/master/wp-content/plugins/cf-pods-filterable

    Download this folder as a .zip and add it as a plugin. In your Layout Editor, add a new Filterable Pods field, which should appear in the Basic category. In the field config, “Filter this Pod by” is your WHERE statement, and the “Field to filter from” is the Pod you’re querying.

    Right now, it has two main states – it’s a dropdown if you want to display the information you receive, or it’s a hidden field containing JSON output if you click “Hide field output.” If you want additional Pod fields in the JSON output, put the field slugs as a comma-delimited list in the “Extra fields from Pods.” Multi-select hasn’t been implemented because there’s a lot of parts to the project this is in, but we have a looming deadline, so it should be completed soon. ??

    You’ll probably need to edit podscall.php, because it has some project-specific code. Edit the line that reads if ($whichpod == "wts_course") and change that to whichever Pod slug you want to use. If it’s not a post type, you’ll also need to figure out what you want to use as the ID and name.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dropdown linked to a custom field (pods) with WHERE condition’ is closed to new replies.