Overview
Enables API connections with Swapcard, with a plugin manager for implementing its various callbacks. Swapcard is a modern web platform for managing all kind of events and related activities.
Contains base module (API implementation) Swapcard as well as some sort of ready-to-use Swapcard Content module that creates and keeps in sync nodes of several possible content types in Drupal with source in Swapcard app. This includes mapping all default Swapcard fields as well as relations between entities, as it is in Swapcard web app. Additional Swapcard Content Media module adds possibility to sync various Swapcard images in our content.
Module is originally commissioned and funded (version 1.0) by International Association of Amusement Parks and Attractions (IAAPA).
Swapcard module
It's a main module and meant mostly for developers. It defines Swapcard plugin, which takes care of formatting Swapcard's Graphql queries and sends request to its API using Guzzle. It defines a base Config form at /admin/config/services/swapcard/config that is designed for Drupal developers and only provides a shell for invoking Swapcard API requests.
Before any usage please make sure to check out Swapcard API page as well as their Graphql explorer.
Visit "Configuration > Web services > Swapcard" and paste your API key. That will automatically trigger a request to validate that connection with remote api works. Then, please look into README file for a code example, how you can use it within your code.
Swapcard Content module
Requires Queue UI module.
Module implementing Swapcard API, creating and synchronising
diverse content/entities from Swapcard into Drupal. NOTE: Enabling it will create 4 content types:
- Swapcard Events
- Swapcard Exhibitors
- Swapcard Sessions
- Swapcard Speakers
With all of the belonging fields. For more info on that check outswapcard_content.settings.yml.
This module extends base module's Config form adding quite some new options, so
if you enable it you should visit /admin/config/services/swapcard/config and
set some preference there. such as opting for Event's entities, defining fields with pre-defined values (i.e. select lists on Swapcard), using test response data, purging entities etc.
Running Sync action from Config form will map and synchronise data in entities in Drupal with those on Swapcard. Same is for having it doing on cron if that option is selected on config form. The whole scenario includes relational logic between entities in form of Content reference field in Drupal. Such as from all entities to parent Event as well as some specific such as Sessions <> Exhibitors and Sessions > Speakers.
This module implements QueueWorker plugin and is sort of designed (tested) on a big response data arrays - around 2500 nodes in a batch, of which almost each contains Media entity attached, including mentioned possible relations between entities.
Swapcard app has possibility for creating custom fields and that is also supported by this module, in the basic terms, for the field types that are already included. Additionally, List type of fields (i.e. dropdown or checkboxes) are designed to mirror and keep in sync with the equivalent field definitions on Swapcard app so #options (key|value) are always the most accurate. This is done though Drupal's field storage method allowed_values_function.
Known problems
- By Swapcard's design Speakers are shared between Events, yet not having
unique "global" id at the same time, but unique one per event.
Because the idea here is to try to NOT repeat same speaker (as a node) in Drupal
we match those by email and name. Very unreliable overall. - Even though each entity has updatedAt property as a part of response object,
that value is only valid for the entity itself and does not reflect if related
(or child) entity(ies) attached to this one were updated,
some of their values changed. This is why syncing will run on matching all,
and every time either on cron or when manually running a batch from config form.
As per current information Swapcard developers are working on this one!
Swapcard Content Media module
Requires Swapcard content and core Media (media_library) module.
Creates Media reference field on Swapcard content types and implements syncing various Swapcard images:
- Event banner
- Exhibitor logo
- Session banner
- Speaker photo
Project information
Seeking co-maintainer(s)
Maintainers are looking for help reviewing issues.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Content editing experience, Developer tools, Site structure
4 sites report using this module
- Created by nk_ on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.




