Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Feature Request: Referenced Section-Templates #1080830

    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 :)

    in reply to: Pushing submission datalayer event with form ajax response #1064012

    Yes, this can be closed. Thanks Mike

    in reply to: Pushing submission datalayer event with form ajax response #1063702

    Hi 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!

    in reply to: Pushing submission datalayer event with form ajax response #1063548

    Hi 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
    in reply to: Pushing submission datalayer event with form ajax response #1059925

    Hi 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

    in reply to: Pushing submission datalayer event with form ajax response #1059741

    Hi 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

Viewing 6 posts - 1 through 6 (of 6 total)