block.schema.yml

core/modules/block/config/schema/block.schema.yml

File

core/modules/block/config/schema/block.schema.yml

View source
  1. # Schema for the configuration files of the Block module.
  2. block.block.*:
  3. type: config_entity
  4. label: 'Block'
  5. constraints:
  6. FullyValidatable: ~
  7. mapping:
  8. id:
  9. type: machine_name
  10. label: 'ID'
  11. # Blocks have atypical machine names: they allow periods for historical reasons.
  12. # @see https://www.drupal.org/project/drupal/issues/2685917
  13. # @see https://www.drupal.org/project/drupal/issues/2043527
  14. constraints:
  15. Regex:
  16. pattern: '/^[a-z0-9_.]+$/'
  17. message: "The %value machine name is not valid."
  18. theme:
  19. type: string
  20. label: 'Theme'
  21. constraints:
  22. NotBlank: []
  23. ExtensionName: []
  24. ExtensionExists: theme
  25. region:
  26. type: string
  27. label: 'Region'
  28. constraints:
  29. NotBlank: []
  30. Callback:
  31. callback: ['\Drupal\block\Entity\Block', validateRegion]
  32. weight:
  33. type: weight
  34. label: 'Weight'
  35. provider:
  36. # @todo Deprecate this from config schema and remove it from the `config_export` definition in https://www.drupal.org/project/drupal/issues/3426278
  37. nullable: true
  38. type: string
  39. label: 'Provider'
  40. plugin:
  41. type: string
  42. label: 'Plugin'
  43. constraints:
  44. PluginExists:
  45. manager: plugin.manager.block
  46. interface: Drupal\Core\Block\BlockPluginInterface
  47. # Block plugin IDs may not be valid in blocks that are backed by
  48. # block_content entities that don't exist yet. Therefore, it's okay
  49. # to consider the fallback plugin ID as valid.
  50. allowFallback: true
  51. settings:
  52. type: block.settings.[%parent.plugin]
  53. visibility:
  54. type: sequence
  55. label: 'Visibility Conditions'
  56. sequence:
  57. type: condition.plugin.[id]
  58. label: 'Visibility Condition'

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.