Forum Replies Created
-
AuthorPosts
-
Well it is a help already, to save a section template and then insert it in another page. But this second step would make work so much more fun :)
February 7, 2019 at 11:02 am in reply to: Pushing submission datalayer event with form ajax response #1064012Yes, this can be closed. Thanks Mike
February 6, 2019 at 5:01 pm in reply to: Pushing submission datalayer event with form ajax response #1063702Hi again,
I fiddled around with the above hints, but couldn’t get it to work. However, your links got me to another thread here, I exchanged the script names, put the contact module js script in /enfold-child/js/ and now it works.
New function to exchange the script reference in functions.php:
function wp_change_aviacontactjs() { wp_dequeue_script( 'avia-module-contact' ); wp_enqueue_script( 'avia-module-contact-child', get_stylesheet_directory_uri().'/js/contact.js', array('jquery'), 2, true ); } add_action( 'wp_print_scripts', 'wp_change_aviacontactjs', 100 );
Thanks!
February 6, 2019 at 10:56 am in reply to: Pushing submission datalayer event with form ajax response #1063548Hi Mike, thx for your help and sorry for the late response. Your solution works. I know this might be outside your scope, but do you have a quick idea why it works on my local dev but not on my live system? On the live system I get the following error thrown, when loading the scripts via child theme:
Notice: Undefined variable: path in [SERVER PATH]/wp-content/themes/enfold-child/shortcodes/contact/contact.php on line 36 Notice: Undefined variable: path in [SERVER PATH]/wp-content/themes/enfold-child/shortcodes/contact/contact.php on line 39 Warning: session_start(): Cannot start session when headers already sent in [SERVER PATH]/wp-content/themes/enfold-child/shortcodes/portfolio.php on line 34 Warning: session_start(): Cannot start session when headers already sent in [SERVER PATH]/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries/masonry_entries.php on line 56
January 29, 2019 at 10:17 am in reply to: Pushing submission datalayer event with form ajax response #1059925Hi Mike, it works for the contact.php, but not for the contact.js. Anything else that needs to be done for the contact.js to be read from the child theme? BW
January 28, 2019 at 6:20 pm in reply to: Pushing submission datalayer event with form ajax response #1059741Hi Mike,
thanks for your help. Yes it’s for GTM. However, with your solution, the click produces the trigger without respecting form validation. What’s needed is the datalayer push only after the success-heading becomes visible.
I found a way to output the data-layer push with form validation in config-templatebuilder/avia-shortcodes/contact/contact.js.
responseContainer.removeClass('hidden').css({display:"block"}); window.dataLayer = window.dataLayer || []; window.dataLayer.push({'event': 'contactFormSuccess'}); form.slideUp(400, function(){responseContainer.slideDown(400, function(){ $('body').trigger('av_resize_finished'); }); send.formElements.val('');});
But how would I overwrite the contact.js in a child theme?
BW
-
AuthorPosts