Skip to main content

Would anyone know how to assign form dynamically via ACF?

I have a "webinar" CPT and would like to define the custom field that would pull the FluentForm shortcode value dynamically. Would anyone know how to go about that?
Here is he example webinar:

https://balanceinhr.com/webinar/health-in-workplace/

Thanks in advance!

AndrΓ© Daus

Which part should be dynamic? ACF doesn’t make it dynamic. It just adds a field.

Drag Ivko

Andre DausΒ the fluent form shortcode.

Basically, I want to create a new form for every webinar so that I can sent the entries to appropriate segment and automate marketing. This page as is now, has the particular form added via shortcode, but how would I go about adding another form to the new webinar without modifying the CPT template?

AndrΓ© Daus

Drag IvkoΒ that’s not how dynamic data works. Usually, you add the custom data in custom fields to the CPT post. You should use only one form per CPT, otherwise it gets messy quickly. Then you create a template that uses the custom field data to render the page dynamically. With Fluent Forms you have different options depending on your particular use-case:

Bonus: If you really want to create a form for each CPT (not recommended!), you can add a custom field for the forms ID and then add it to your template with a placeholder in the basic shortcode [fluentform id={custom_form_field}] (depending on your templating).

Not every option will work depending on your theme. I use Bricks Builder with BricksExtras, so I’d go for option #3 (because it does not work with shortcodes). In any other case go with option #1 or #2.

Drag Ivko

This is so helpful Andre, let me look into the links you shared. Thanks so much!