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. Sequentially:
  30. constraints:
  31. - NotBlank: []
  32. - Callback:
  33. callback: ['\Drupal\block\Entity\Block', validateRegion]
  34. weight:
  35. type: weight
  36. label: 'Weight'
  37. provider:
  38. # @todo Deprecate this from config schema and remove it from the `config_export` definition in https://www.drupal.org/project/drupal/issues/3426278
  39. nullable: true
  40. type: string
  41. label: 'Provider'
  42. plugin:
  43. type: string
  44. label: 'Plugin'
  45. constraints:
  46. PluginExists:
  47. manager: plugin.manager.block
  48. interface: Drupal\Core\Block\BlockPluginInterface
  49. # Block plugin IDs may not be valid in blocks that are backed by
  50. # block_content entities that don't exist yet. Therefore, it's okay
  51. # to consider the fallback plugin ID as valid.
  52. allowFallback: true
  53. settings:
  54. type: block.settings.[%parent.plugin]
  55. visibility:
  56. type: sequence
  57. label: 'Visibility Conditions'
  58. sequence:
  59. type: condition.plugin.[id]
  60. label: 'Visibility Condition'

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