-
AuthorPosts
-
November 19, 2014 at 2:11 pm #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?
November 19, 2014 at 2:56 pm #353692A 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
November 19, 2014 at 3:07 pm #353705Hi 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ünterNovember 19, 2014 at 4:04 pm #353750It 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 ;)
November 19, 2014 at 4:16 pm #353760Hi!
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ünterNovember 19, 2014 at 4:56 pm #353789One 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.
November 20, 2014 at 11:33 am #354205Hey!
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ünterNovember 20, 2014 at 11:42 am #354216Thanks 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 allCheers
TJ
November 20, 2014 at 11:48 am #354219 -
AuthorPosts
- The topic ‘Is it possible to view and edit a pages html?’ is closed to new replies.