Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Since we're looking at a system that would allow auto-ingesting components as Drupal plugins (probably blocks), we should also look at implementing an editor interface for Component Presenters.
An existing module implements this functionality: https://www.drupal.org/project/patternkit
Roadmap Suggestion:
- New plugin type: Component, auto-populates based on component.yml definitions inside Extension (module/theme) folders
- Includes several default components based on commonly used HTML templates as examples
- See #2707849: Allow a component library to define asset libraries
- New plugin type: Presenter, code snippet or twig inline template that can take input (field w/ Component formatter, view Component display, other presenters etc.) and outputs a string or array to a Component plugin
- Includes several twig function-based Presenters (uppercase, lowercase, trim, if/else, choose array value etc.)
- Includes a 'custom' type that uses the typical theme system template suggestions, allowing you to hand-write your own presenter, similar to how we often do it now
- New field formatter plugins: Component, transforms most field plugins into string or array values
- New Views display plugin: Component, transforms views output into a string or array of values
- New widget plugin: Node-based Graph Editor, allows connecting Presenter plugins visually together to generate output HTML, http://codepen.io/cyb_tachyon/pen/VPygVW as an example
- New auto-discovery block plugin: Component Block, auto-populates based on Component plugins - this is essentially the same plugin that's already being worked on here
- Block plugin uses the Node-based Graph Editor widget to allow Visual Node-based Programming of Fields connecting Presenters in chains to Components
Some discussion points:
- Do we need a Node Graph Editor for presenting the data model to front end components? It's complicated UX for a relatively simple process (data mapping). Is there a better solution that covers most use cases?
Comments
Comment #2
cyb_tachyon CreditAttribution: cyb_tachyon as a volunteer and at Red Hat commentedJust a quick update on my WIP: We've done some testing and have come up with using tokens as an alternative interface to a Node Graph Editor for most use cases, although we'd still want an interface that handles complicated data mapping.
I'll continue to update this issue as I make more progress and monitor it for feedback etc.
Comment #3
cyb_tachyon CreditAttribution: cyb_tachyon as a volunteer and at Red Hat commentedWork that my team is doing for this issue will be visible here for now, since we're looking at solving this in both D7 and D8: https://github.com/drupal-pattern-lab/roadmap/issues/8
Comment #4
JohnAlbinClosing. As I'm not 100% sure what "a system that would allow auto-ingesting components as Drupal plugins" even means. :D
Comment #5
cyb_tachyon CreditAttribution: cyb_tachyon commentedNo worries, there's a separate module that implements this functionality here: https://www.drupal.org/project/patternkit
I haven't figured out a way to make it Component Libraries compatible, but that's on the backlog to happen. For now, it's standalone.
Comment #6
cyb_tachyon CreditAttribution: cyb_tachyon commented