Users of WP Maps have the ability to use JS codes to change or modify certain elements of their product or store locator widgets.
For example, WP Maps users can replace the default contact form with a HubSpot contact form using the JS code editor. Furthermore, any platform’ contact form can be added by using the JS code editor.WP Maps users can use the below functions (or methods) to bind and create different events:
- toggleClass(selector, myClass)hasClass(selector, myClass)removeClass(selector, myClass, _doc)addClass(selector, myClass, _doc)display(_ele, _style)deleteElement(_node)addEvent(_selector, _cb, _scope, _event_type)emptyElement(_node)createElement(_element, _attributes, _inner)alert(_message, _type, _cont)
To access the JS Editor, please follow the below steps:
- Log into your WP Maps account and click on the “Widgets” tabGo to the “builds” section, press “Options” on a build you wish to modify and select “Customize”
- On the “Template Customizer” page, select the element you wish to modify using the “Template Section” drop-down menuPress the “JS Code” button to open the JS editor to modify the template you have chosen
- Enter the JS codePress “Save Code” when you are done
- Head back to the “Widgets” page and refresh the build by pressing “Update”
Once you have updated the build, you can preview the product or store locator widget to verify if the changes have been made.In the below images, we have changed the default WP Maps lead form to a lead from by Hubspot.
For any questions or concerns, please feel free to reach us at [email protected]