Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #353653

    So…
    I have used the advanced layer builder to create the site and all is good.
    I want to add some onclick event handling code to every button/image so i can track who goes where and what they do. Is there a way to add the code directly into a pages html? I’ve changed to the Default Editor but its blank with no html.

    I’d rather not go through and change every image and every button element to a code element and paste the relevant shortcodes if i can help it.

    Does enfold store the pages data as html or is it all purely database that is then pulled?

    #353692

    A bit of poking around the forums (maybe should have done that first) has come up with this…

    //set builder mode to debug
    add_action(‘avia_builder_mode’, “builder_set_debug”);
    function builder_set_debug()
    {
    return “debug”;
    }

    to turn on debug for the layer builder.

    What are the ramifications of editing in there? Is it safe to add my onclick handlers in there?

    Cheers

    Tim

    #353705

    Hi tjswarbs78!

    Thank you for using our theme.

    The best way to achieve this is with jQuery. I would give the buttons and images unique id’s or classes and after loading the page I would attach the “onclick” handler with jQuery.

    The js file with this code can be loaded in the WP action hook ‘wp_print_styles’.

    Regards,
    Günter

    #353750

    It isn’t possible to add id/classes to buttons etc in the layer builder?

    In any case jQuery is way over my head at the moment as I’m just starting out.I’d ask you to help out but it isn’t really theme related and that’d be cheeky!

    I’ll risk using the debug to add in the code… what’s the worst that could happen!…

    Tim

    PS. Cracking theme by the way ;)

    #353760

    Hi!

    Thanks for coming back.

    Look at: http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/.

    This enables you to add custom classes to your elements.

    It is not recommended to use the debug feature in real life sites due to security reasons and unless you are sure, what you are doing.

    Make a complete copy of your database and WP directory before you use the debug feature.
    Worst thing is you have to restore your database and WP directory from your backup.

    Alternativly you can check it out in a test environment before.

    Regards,
    Günter

    #353789

    One last question (and I feel i know the answer)..

    this is what I’m after for the button links…

    a href=”#contact” onclick=”contact; clicky.log(‘#contact/contact-trigger-main-page’,’click’); return false;” class=”avia-button avia-icon_select-no avia-color-theme-color avia-size-large avia-position-center “><span class=”avia_iconbox_title”>GET IN TOUCH<

    that works fine on code blocks. Is there a way to get that onclick into the shortcode for buttons and get it working?

    [av_button label='The Software' link='manually,http://www.linkhere.com' onclick bit here]

    As i say jQuery is beyond me but I’m learning slowly.

    Cheers for the help

    Tim

    • This reply was modified 10 years ago by tjswarbs78.
    #354205

    Hey!

    Thank you for coming back.

    Sorry, not out of box again. But you can try to modify the following file:

    enfold\config-templatebuilder\avia-shortcodes\buttons.php

    The function shortcode_handler handles the output of the button.
    popup_elements handles the input elements in the popup window. Here you can add an additional inputfield to identify your button.

    I hope, this will help you.

    Cheers!
    Günter

    #354216

    Thanks for getting back to me again really appreciate it. I’ll give it a whirl.
    I see from the forum you lot get bombed out so hats off to you all

    Cheers

    TJ

    #354219

    Hey!

    I hope, it will help you.

    Feel free to come back with further questions.

    Enjoy the theme.

    Regards,
    Günter

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Is it possible to view and edit a pages html?’ is closed to new replies.