fossasia.org
fossasia.org copied to clipboard
Speaker/Sponsor/Schedule Section Integration – Current Implementation Recap
Continued from previous issue: #887
As part of extending the functionality of the event pages generated using The Events Calendar plugin, I attempted to integrate three additional sections as requested:
Sections Implemented:
-
Schedule Section (linked button): Implemented via a custom field named schedule_link using the Advanced Custom Fields (ACF) plugin.
-
Speakers Section: Created using a plain text field called speakers that currently supports a short paragraph or names separated by commas.
-
Sponsors Section: Added similarly with a basic sponsors field supporting only plain content input.
Implementation Approach Used ACF (Free Version) (link:https://wordpress.org/plugins/advanced-custom-fields/) to create custom fields (schedule_link, speakers, sponsors) associated with the tribe_event post type.
Edited the template file:
bash Copy Edit /wp-content/themes/[active-theme]/tribe-events/single-event.php Injected the following conditional PHP blocks to render the ACF fields within the event layout:
php Copy Edit
<a href="<?php the_field('schedule_link'); ?>" target="_blank">View Full Schedule</a>
<div class="speakers">
<h2>Speakers</h2>
<p><?php the_field('speakers'); ?></p>
</div>
<div class="sponsors">
<h2>Sponsors</h2>
<p><?php the_field('sponsors'); ?></p>
</div>
Limitation & Research Notes While the schedule link is working as intended, both the speakers and sponsors sections are currently limited to a plain text layout. My aim was to create repeatable structured cards (with name, role, links, description for each speaker), but after exploring various options, it appears that:
The required Repeater Field functionality and flexible content blocks needed for this kind of dynamic UI are part of the ACF Pro plugin.
As of now, the free version does not support grouped repeatable fields or nested structures natively. I explored workarounds using manual code and Pods, but those either:
require complex manual field creation and PHP handling,
or introduce additional plugin dependencies without card support.
Conclusion I’m sharing the current working version I could build using ACF (free) and template modification. If anyone knows of a more efficient or plugin-based method to build repeatable cards dynamically without ACF Pro, I'm open to trying it out.
Screenshots of the event page:
@NishilHoogar For the events, it will be drawn from eventyay primarily. There isn't a need to populate the event information through WordPress as the data is available via API at https://api.eventyay.com/.
If it helps, the following is a suggestion as to the directions to take on doing the events section:
- Custom post type
- Middleware
- Event listing
- Event detail page
- Event schedule page/tab
- Event speakers page/tab
Custom post type
Create a custom post type for events. Every event item should be created using the custom post type. The custom post type will have additional metadata that is not configurable:
- Eventyay ID
- Event description
- Event start/end date/time
The above metadata is to be updated through Eventyay.
Through ACF Free, it should have a minimal set of configurable metadata:
- Featured event checkbox (if you have a featured event design)
- Do not display checkbox (to allow a basic filter of what event to be output. Maybe for some reason, some events are not to be shown on fossasia website.
Middleware
The middleware is where we call Eventyay's API for updated information. This is where we should handle periodic updates as well, i.e. codes to invoke WordPress cron handling for automatic refresh of the event calendar.
Events can be drawn through the /v1/events{?sort,filter} end point. Everytime the middleware pulls in the updated/new information from Eventyay, the middleware should create new event post type with Eventyay ID, description and start/end date/time, and title.
Event listing
On the frontend, it would be the WordPress archive page of the custom post type. Visually, it can be a calendar view, or a list of upcoming events by month.
Event detail page
On the backend, this is the custom post type as described above. In wp-admin, the configurable metadata can be updated via the ACF Free plugin. There should also be a button to refresh the event's individual information from Eventyay API. On the front end, it should show at the minimum the Event name, title, description, and CTA click through to the event's page on Eventyay. Relevent API endpoint might be /v1/events/{event_identifier}
Event schedule/speakers pages/tabs
These pages/tabs should show the schedule/speakers from Eventyay's API. I leave it to you to decide if the information should be stored in the event custom post in WordPress as metadata as well. Relevant API might be /v1/events/{event_identifier}/sessions{?sort,filter} and /v1/events/{event_identifier}/speakers{?sort,filter}
@hpdang, @mariobehling please confirm if the API endpoints are the right ones from eventyay. Also further questions would be:
- Are there any API limits to observe?