Problem/Motivation

A few components like the list of opening instances on the calendar entity or the slots and booking button on opening instance entities are hard coded and always rendered and displayed when viewing those entities.

This should be configurable, so that the site builder can decide if and where those components are displayed. And at the same time, those components would also be useful as fields in views. Both of those requirements can be delivered with the same solution.

Proposed resolution

Turn the building of those components into a service. Add pseudo fields for those components and only call the rendering from the service when configured accordingly.

Then, also add them as views fields, using the same code from that service.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Status: Active » Needs review

The MR contains all the code to achieve this issue's goal, please have a look.

josh.fabean made their first commit to this issue’s fork.

josh.fabean’s picture

@jurgenhaas, I tested that locally and existing display looks exactly the same before and after your changes, and it does allow for more flexibility. Thank you for the changes!

This is pushed to latest 2.2.x and it will end up in 2.2.4 shortly here.

josh.fabean’s picture

Status: Needs review » Fixed
josh.fabean’s picture

Version: 2.2.x-dev » 2.2.4
Status: Fixed » Closed (fixed)