Hi guys,
I have one problem and can't solve the issue, any help will be appreciated.
I have current showcase site (www.wrightco.net) where we host our demo listing environment for our future clients. After some years we decided to move forward and to upgrade toolset layout and use the toolset relations.
In this current site, on the listing content template we have Gravity form on the right side (for example: hidden link -> hidden link). This Gravity form is using data from the current listing (broker email address) and I'm sending to that email address client request. This broker email field is part of the Listings custom post type layout. Please check this attached screenshot: hidden link. And we can successfully at the end send requests to broker email (hidden link).
In new layout (hidden link), I don't have any more this custom field (broker email) as part of the Listings custom post, but I'm using relations and pulling those informations that way in listings content template. Now, when I want to showcase related broker for that listing, I'm using this shortcode: {!{types field='email' item='@broker-listing.parent'}!}{!{/types}!}. But now, I don't know how to set that custom field in Gravity any more, as gravity doesn't understand this. Here is that page on new development site: hidden link
Can you please help me solve this issue
Thanks
Sasa Vidakovic
Deal Studio
Hello, it looks like you are able to display the information using a Toolset Types field shortcode, but you need a way to insert that value in a Gravity Forms element somehow. I'm not really the best source of information about how to use Gravity Forms like this, because I'm not trained in their software and there is no direct integration layer between Toolset and Gravity Forms. If it's possible to use a custom shortcode to insert information in their software, I can help you create a custom shortcode or some other PHP function to retrieve the correct value, but I'm not sure how to implement something like that in their software. Their support team might be able to help you set up something like a custom function or shortcode, then I can help you implement Toolset's API in that custom code.
I did a quick search and found these documents in their site:
https://docs.gravityforms.com/allow-field-to-be-populated-dynamically/
https://docs.gravityforms.com/using-dynamic-population/
It seems that you might be able to use parameters to populate default field values dynamically. If those parameters support 3rd-party shortcodes, you might be able to pass the Types field shortcode into that parameter to set the value dynamically. I'm not really sure, their support team would be able to determine whether or not their shortcode parameter system supports nested third-party shortcodes, like this example:
Test email field shortcode: [types field='email' item='@broker-listing.parent'][/types]<br />
[gravityform id="1" field_values="parameter_name1=[types field='email' item='@broker-listing.parent'][/types]"]
In the example, I have included code to test the email field shortcode is working correctly, then I have included a Gravity Forms shortcode with some parameter called "parameter_name_1". This example should output the email field value, then the Gravity Form. You would then be able to set the default field value using parameter_name_1 as the parameter source.
If the Gravity Forms parameter system accepts third-party shortcodes, this might be a practical solution. Otherwise, we need more information from the Gravity Forms team about how to set a default field value using a PHP function or a custom shortcode.
Hi Christian, it works! Thanks
My issue is resolved now. Thank you!