Can this module be used for Content and non-Content Entities? and then create a Calendar

Created on 1 March 2024, 10 months ago

Problem/Motivation

Scenario is

- Drupal content type of Event - used for events that just have information but not booking

- CiviCRM Event - used for events with bookings.

Note civicrm_entity module means that civi entities are available in Drupal eg for entity reference, and for views and much more.

Steps I tried
- create Content based View of my Drupal event nodes and add an Entity Reference field
- create CiviEvent-based View for my civi events and add an Entity Reference field
- create a Content based View for doing the combining and add the following fields

Content: Rendered entity
Global: Views combine (civievents_test:default) [hidden]
Global: Views combine (drupal_events:default) [hidden]

and I do indeed start seeing both civi and drupal data here. Great.

Next step

Goal 1 would be to list this combined data as a table sorted by the date field in each of the two entities, so we get a chronological list of events

Goal 2 would be to then render this as a Calendar

Do these two Goals seem likely to be achieved by this approach (and many thanks for making this approach available)

💬 Support request
Status

Active

Version

1.0

Component

Miscellaneous

Created by

🇳🇿New Zealand petednz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @petednz
  • 🇳🇿New Zealand petednz

    Goal 1 seems to have worked, much to my surprise, with a mix of both Drupal and Civi events seeming to display in a combined chronological order.
    "Sort currently only supports the entity created or changed timestamps"
    Not sure I follow how it has succeeded - or perhaps it just inherits the 'sort' info from the incoming views and therefore sorts them based on the combination of those - or maybe i just got lucky with my random examples.

    Goal 2
    Based on "Supported display handlers. Only view displays of the field handler type are compatible. Future versions could support additional display handlers."
    I am guessing the calendar or even table option is a 'not without considerable effort'

  • 🇨🇦Canada b_sharpe

    I see no reason why #2 can't work.

    The restriction is definitely around field output + rendered entity; however, using either the style plugin (i.e. unformatted/grid/table) and/or twig + js could likely get you to a Calendar display. Things like tables obviously aren't great since field output is always one column, but for a calendar you likely could extract from each entity what you need (i.e. date/time) in template/preprocess.

Production build 0.71.5 2024