Event Plugins

Hi

I am planing to add a list of courses (with a registration form). Has anyone used any of the bunch of the WP Event Plugins with frontity yet?

I did try a few of them but none really exposed all the information over the API. The most complete was https://theeventscalendar.com/knowledgebase/k/introduction-to-the-events-calendar-rest-api/ but they are exposing their “own” API on wp-json/tribe/events/v1/events.

Any suggestion on a an event plugin?

Hi @phn

I’m not too familiar with event plugins so am unable to make a specific recommendation. But if you find one that has the functionality you need but doesn’t expose it’s content in the WP REST API it’s possible to add it by adding a bit of code to your site’s functions.php file or in a custom plugin.

See here for how to do this.

Hope this helps.

1 Like

Thanks @mburridge , I’ve tried that now. I can see those custom post_types in the wp-json API now: https://frontity.hei-schule.ch/wp-json/wp/v2/tribe_events. But there’s barely anything exposed

here’ the link to the page on the WP side https://frontity.hei-schule.ch/event/123/. Content is rendered on the go. Also do they have a lot of functionality in separate JS files. I might try to use Iframe…

Hi @phn

I’m guessing what you’re missing are the event dates. Those are probably Custom Fields (also called Post Meta) associated with the Events CPT. They will also need to be exposed in the REST API.

You could code a solution to this in PHP, but you may want to focus more on the Frontity based front end of your site, so you might find this plugin useful.

1 Like

oh, that plugin looks nice

Hi, I am back with this topic :laughing:

So far, I have created a custom post type for the Events/Courses in WP and added them to the REST API. Now I would like to have an overview page on frontity (like /courses/) with a listing of all posts of the custom post type (and maybe doing some filtering with that list) and ofcourse having a link to the subpage then (eg. /courses/mycourse01/).

Is there a way in querying all posts of a certain type in frontity? Or should I create an archive page in Wordpress itself and try to show that one on Frontity

I have managed to get a solution with a custom handler:

export default  {
pattern: "/kurse/",

func: async ({ route, params, state, libraries }) => {
  state.source.data["/kurse/"].isCourseList = true;

  const response = await libraries.source.api.get({
    endpoint: '/wp/v2/courses/',
  });

  const items = await libraries.source.populate({ response, state });

    Object.assign(state.source.data[route], {
      isCourseType: true,
      items
    });
  },
}
1 Like

Hi @phn

To get an archive listing like the one you describe you just need to add the archive property when you define postTypes in frontity.settings.js. See our docs here.