block.schema.yml

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

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