Skip Navigation

[Resolved] Create a from using another CPT fields

This support ticket is created 2 years, 9 months 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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 2 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#2288881

Hi,
My website is a real estate website for properties in the mountain.
I'd like to create a form to record the info request of the potential clients (CPT "demandes d'informations").
In this form Id like to display pictures related to a ski station.

The idea is to create 1 form and automatically customise it with ski station pictures. The specific ski station should be defined in the url of the form.

For example,
hidden link will display the form. Within this form there will be pictures of the CPT "Ski-station" item "Maribel".

Without creating a new form in the backend, I'd like to have hidden link, displaying the same form but with the pictures related to Chatel.

The idea is to have as many links as there are ski stations, but having a unique form retrieving picture from the CPT "ski-station"'s in order to include the links in an bulk email. Bulk email will show 4 ski stations with a "more info" button that should link to the different url's of the form.

Not sure my explanations are very clear nor if it's possible to do it "easily"...

Thanks for your help.

Best regards

#2289319

Hi,

Thank you for contacting us and I'd be happy to assist.

For what you're planning, you'll need a fair amount of customization.

To achieve this custom URL structure, you'll need to use WordPress' custom URL rewrite rule feature, as explained in these guides:
hidden link
hidden link

Once you've managed to deploy this custom URL structure, you'll be able to get the target ski station's slug from the URL using the "get_query_var" function:
https://developer.wordpress.org/reference/functions/get_query_var/

From that slug, you can get that ski station's post ID and then retrieve its images from the custom field:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image

I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar