Snippets for Getting/Formatting Data from Event Calendar Plugins

Thank goodness for Dynamic Data tags in Bricks; being able to yank data out of the database post table and postmeta keeps me from pulling my gorgeous hair from my misshapen cranium. Particularly helpful with literally any plugin that doesn’t provide bricks elements for building loops (the events calendar, eventin, etc.)

A very non-exhaustive pair of snippets:

The events cal: The Events Calendar and Bricks Builder Snippets.md · GitHub

eventin (which I don’t care for) Eventin and Bricks Builder Snippets.md · GitHub

Big ups to Sridhar Katakam and Bricks Labs

4 Likes

Hey @digisavvy,

Noticed your dynamic tag ‘_tribe_events_virtual_url’. Were you able to include Zoom or YouTube content in a Bricks Template? If so, how?

Have been searching far and wide to find an answer.

Hey @mizzinc !
I’m not using the events calendar any longer, I opted for a different calendar solution.

What specific content are you trying to get to display in bricks from TEC?

If an event post already has all the data you need within it you could try querying the database to find the appropriate key associated to the data. Once you have that you can use bricks to output the value with dynamic data tags or write the custom PHP to do it.

You’ll want to connect to your database and run this command. Update post type and post id for your use case obvs.

SELECT *
FROM wp_postmeta
WHERE post_id = {your_post_id}
AND post_id IN (SELECT ID FROM wp_posts WHERE post_type = '{your_posttype}');

Thanks for the lightning fast response.

Im trying to display a Zoom meeting, that meets a lot of criteria. Such as, publish 15minutes before start time. Slightly more complex than grabbing post_meta.

Since, I saw you were fetching the Virtual URL, I thought maybe you might have also tackled how to embed. Which is simple for a YouTube of course.

I haven’t, no.

But this article provides content on how to do it : Embedding content using the iFrame widget - you just need to be able to identify the meeting ID/URL from within your database. You could try running such a query through chatgpt to see what you get. But if you have the iframe code, and the URL, it’s really as simple as putting together a code block or writing a PHP function to output your content.

Very simple and then its a case of applying the surrounding conditionals, Member vs Non Member etc.

I ended up falling back on overriding TEC (Tribe) templates.

My design required all TEC elements at the top of the page and after that a Bricks Single Post Template which displayed other upcoming events.

To include content from both.

Override tribe/events/v2/default-template.php in your child theme and include the following code: The Events Calendar Single Event and Bricks Builder Template - Pastebin.com

  • Set conditions for Bricks Single Template to PostType Events.
  • Set TEC Settings > Display > Events template > Default Events Template
1 Like

Would you mind posting what your different calendar solution is please? Also, the main reason(s) why you didn’t use Event Calendar (I’m currently building an event site, so interested). Thanks.