As a themer I would like to define my own Modifier plugins and include them in the theme and define YAML for them. Modifiers should be able to discover these plugins.

See this article
https://www.drupal.org/docs/8/api/plugin-api/creating-a-plugin-that-can-...

Comments

murrayw created an issue. See original summary.

kyberman’s picture

Status: Active » Needs review
StatusFileSize
new2.97 KB

Created patch to solve this problem.

You can now place plugins into theme and specify them by YAML definition.

Example - I have "my_theme" and want to add "test_modifier":
- Create "TestModifier" class inside "my_theme/src/Plugin/modifiers" folder.
- Create "my_theme/my_theme.modifiers.yml" file with this content:

test_modifier:
  class: Drupal\my_theme\Plugin\modifiers\TestModifier
  label: 'Test Modifier'
  description: 'Provides a Modifier to test an element'

  • kyberman committed e9ae72d on 8.x-1.x
    Issue #2934388 by kyberman: Discover Modifiers defined in theme
    
kyberman’s picture

Assigned: kyberman » Unassigned
Status: Needs review » Fixed

New release will be created soon.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.