Wordpress Events Editor
Create your event templates to react to some changes on the page
Events Editor Page
Events Editor is created to help you react to some events that are emitted by our embeddings. This helps if you are not too familiar with the code, however you are looking to show something once the recording is created.
To help with this, we have created 2 types of events:
- Alert
- Template
Both of these events are available for all of our Embedding Events the only difference is what will happen once the event is triggered.
Working with Alert Events
Alert is utilizing the JavaScript alert feature that shows a popup on the page to alert the person of something. This is the least stylish option, however it is easy and quite familiar to everyone.
As there is not much that can be done when this happens, it is useful to tell your customers some message such as "Your video is accepted. You can proceed to the next step". It can of course be any text you want.
For the above, all you would really do is to add a shortcode to your page that looks like so:
[ziggeo_event event="verified" message="Your video is accepted. You can proceed to the next step." type="alert"]
The first part [ziggeo_event tells your WordPress system that this is our event shortcode.
Next is the event name, which you would find on the above mentioned Events page. With this option you are telling our JavaScript code that it should wait for verified event and then react to it.
In the message parameter you are setting up the message that should be shown in the alert box. We have used the same example in text and then in code and this is the part that you can edit to match your requirements.
The last is the type="alert" which tells our JavaScript code that we want to raise an alert with the above message.
As this is very simple event, it is not possible to save it, just to generate it's shortcode to add to page. So all you need is to click on the Generate Shortcode and you will get the code to add to your pages.
Working with Template Events
The Alert events are quite simple however do not offer much in terms of customization. This is why we have also added the template event type. This type is ideal if you want to have your own code run as the event fires.
Unlike the Alert we do suggest checking your code and how it works after setting it up. It is possible that your code is not accepted or processed properly on page load, so confirming after saving is the best way to make sure it works just as expected.
The template code can work in 2 different ways - the code is added to the page as soon as the page is loaded, or the code is activated as soon as the event fires.
On Page load gives you more freedom to add your own custom code that hooks into everything and does what you want it to do. It expects HTML code to be added into the custom code field, which means that any JavaScript code must be placed within the tags or it will not work as expected.
On Event Activation is a way to set up the JavaScript code that would be injected within the pre-made function. It expects that you add pure JavaScript code (without HTML codes), however it makes it easier for you to find the embedding and the values that the event might offer you.
Both of these will allow you to save the template and then utilize it on any page with code like similar to this:
[ziggeo_event id="event_id_set_in_editor" type="template"]
or
[ziggeo_event event_id_set_in_editor]
The above "event_id_set_in_editor" would be equal to the event ID that you have set up yourself.