Skip Navigation

[Resolved] Populating CRED form with data from current post.

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 5 years ago.

Assisted by: Luo Yang.

Author
Posts
#1369495

Tell us what you are trying to do?
___
I'm working on a real estate website, with custom post types for Homes, Builders, and Agents. I have set up relationships between these post types (each Home has one Builder, each Builder has multiple Agents, each Agent has multiple Home listings, etc.). When a home is displayed on the front end, the associated Builder and Agent are also displayed.

I would like to create a "Request More Information" form that gathers a visitor's name and email address, and sends an email to the Agent requesting more information about the property that they are currently viewing.

Ideally, we would also have a "Leads" post type, and submitting this form would also create a new "Leads" post. The post and the email notification that is sent to the agent should include fields for the Home address, the agent assigned to that Home, the URL of the Home, and other useful info.

So, after that long-winded setup, my question is, can data from the currently displayed post be passed along to create a new post via a CRED form?

I'm also very familiar with Gravity Forms and thought about using it, but I can't seem to pass data from related posts to it.

Thanks in advance for any help you can give to point me in the right direction 🙂

Is there any documentation that you are following?
____
No

Is there a similar example that we can see?
____
I've looked around, but can't find a similar scenario.

What is the link to your site?
hidden link

#1369777

Hello,

I assume we are talking about the:
Post types:
- "Builders"
- "Agent", with custom email field "agent-email"
- "Home"
One to many relationship between post type "Agent" and "Home"

If it is, it is possible within Toolset plugins, for example, you can try these:
1) Create two post type "Leads", with a custom email field "parent-agent-email"
2) Setup one-to-many relationship between post types "Home" and "Leads"
3) Create a post form for creating "Leads" post,
- Populate the field "parent-agent-email" with email field "agent-email" value of parent "Agent" post.
- Send the email notification to email field "parent-agent-email", and display it's parent "Home" information + grandparent "Agent" post information.
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-one-related-item-parent
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/

4) In single "Home" post, you can display above child form link by following our document:
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/