Skip to main content

Hi! I’m using Events to host on-demand webinars. The challenge is that the past event date still shows, which makes me worry people think it’s over instead of available to watch. I’m using Events because it’s the best way to organize and display the webinars.

Is anyone aware of a way to hide or remove the date for on-demand events? Any tips would be greatly appreciated!

Thanks,

Stine

You can probably use some script that catches if your event is “on-demand webinar”. Something like this:

$(".event-item-detail-container").each(function () {
const $container = $(this);
const typeText = $container.find(".event-detail-item__type").text().trim();

if (typeText === "on-demand webinar") {
$container.find(".event-item__date").hide();
}
});

Add it before the </body>.

It's not the most stable as it just looks at the text, so if your site gets translated it won't work for example...


Thanks ​@jvdc! I tried on our sandbox but could not get it to work. Thank you anyways :) 


did you enclose in between <scrip> </script> ?


I did...now 😅 But it did not make a difference 

 


Hmm ok, on your stage site, do you have events with the tag ON-DEMAND WEBINAR ?


I do 🙂 I added in lower case also, in case it was case sensitive.


Ok, I was just trying with the console, but did not actually inject in the 3rd party scripts… 😅 jquery doesn't seem to work actually… sorry.

 

But I did test this and it works!

<script>
document.querySelectorAll(".event-item-detail-container").forEach(item => {
const type = item.querySelector(".event-detail-item__type");
if (type && type.textContent.trim() === "On-demand webinar") {
const date = item.querySelector(".event-item__date");
if (date) date.style.display = "none";
}
});

</script>

 


This works, thank you! It removes the date from the overview page which gives a much better experience. 


Reply