Embedding the AddEvent Calendar in Bubble
Welcome to part two of our miniseries looking at AddEvent, which is going to help us add really advanced calendar features into our Bubble app. The point where we got to in the previous video is that we've created a calendar in AddEvent and we've linked it back to a current user in our Bubble app and we've got the calendar unique id. So let's go about embedding it in our app.
Accessing the Calendar Embed Code
To do that I'm going to go into AddEvent and if I go back here we can now see a list of all of our calendars and the one I'm working with, the one I created in the previous video is demo three and so I can go ahead and go into this page here and look at what I can do and so I want to embed the calendar and I'm going to click customize and share and then I'm going to click show embed options and you can see there's tons that you can customize here but I'm just going to copy this for now and let's go back into our Bubble app design and we're going to add in some HTML.
Adding the Calendar to the Bubble App
Make it nice and big, in fact I'm going to make sure that it's 100% width and I'm just going to paste the HTML in there and I'm going to see what that does right away. Okay brilliant, I mean there's our calendar it's working but this is the embed code for the calendar that we created. This is not going to be dynamic if I logged in as a different user I would be seeing this user's calendar and not current user's calendar.
Making the Calendar Dynamic
So we need to dynamically change some of the code. So in here we can basically see it the different calendars that are displayed and this is the unique ID here for the calendar and we just want to update that. So I'm going to change this to current user calendar ID. Now I'm not actually sure how many of these need to update I might ask the team at our event what's the vital bits here why is the ID listed so many times but I'm just going to update all of them where I can see that the ID should be dynamic.
Debugging the Calendar Display
Okay and let's preview just to check that's still working. Ah it's not being found okay let me go in and I'm going to inspect the HTML element and it's not filled in because current user's calendar ID is empty. Ah am I okay having said that I think I'm running this app as the wrong user so let's go back in here and run as this user. No it's still not working okay let's debug it let's debug it.
Resolving Privacy Rule Issues
Ah right this I'm building this in an app that I've done so many demos with and actually I've become found of this before which is that I have privacy rules set up on my user and so my current user can't access the calendar ID field. Now I'm going to keep this segment in even though if you are building this from scratch you shouldn't have encountered this issue simply because it highlights quite a vital you know part of why you may experience a bug like this. Let's try that now there we go okay yeah definitely keep that in hopefully that is useful.
Next Steps in the AddEvent Series
So let's have a look at the time I think we'll wrap that up for this video and then in part three we'll add an event into here and then we'll really get cooking because I'll show you probably in part four how we can add a subscribe button so our users can subscribe straight into this calendar.