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
  • 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

cyb.tachyon created an issue. See original summary.

cyb_tachyon’s picture

Just 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.

cyb_tachyon’s picture

Work 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

JohnAlbin’s picture

Status: Active » Closed (outdated)

Closing. As I'm not 100% sure what "a system that would allow auto-ingesting components as Drupal plugins" even means. :D

cyb_tachyon’s picture

No 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.

cyb_tachyon’s picture

Issue summary: View changes