• Resolved FreDeRoover

    (@frederoover)


    We are experiencing a technical issue with one of our client’s website involving the display of multiple subscription forms. Our client uses various forms, each designed for subscribing users to different lists. We aim to dynamically display these forms in the front end based on an ACF (Advanced Custom Fields) relationship field selection.

    The challenge arises when integrating these forms with the MC4WP plugin. While each form functions correctly when used individually, the integration fails when attempting to display them dynamically via ACF. We suspect the issue lies in the data-name attribute, which seems to retain the same value across different forms, leading to a conflict.

    Here is the snippet of our current implementation:

    <?php 
    $posts = get_field('contactformulier');
    if ($posts) :
    	foreach ($posts as $p) :
    		$mc4wp_id = $p->ID;
    		echo do_shortcode('[mc4wp_form id' . $mc4wp_id . '" ]');
    	endforeach;
    endif; ?>
    

    The code aims to retrieve the form ID and render the corresponding form via a shortcode. However, we are unable to dynamically fetch the form titles or uniquely identify each form using the $p object.

    We have explored various attributes and methods but have not found a solution to retrieve the form title or differentiate the forms effectively.

    Could you please provide assistance or guidance on how to resolve this issue? We are looking for a way to dynamically display the correct form with unique identifiers in a way that integrates seamlessly with both ACF and the MC4WP plugin.

    Thank you for your attention to this matter.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor Lap

    (@lapzor)

    Hi,

    I was just cleaning up the forum and now see your unanswered post from over a month ago! We’ve had some intermittent issues with not receiving the notifications from the WordPress forum lately. Sorry about that!

    If you still need support with this, especially since you are using our Premium add on, I recommend you contact us on support at mc4wp .com as that is where we handle any support requests for our Premium users.

    Kind regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Issue with Dynamic Form Display Using ACF Relationship Field and MC4WP’ is closed to new replies.