Question

I encounter this error when override empty.xml Layout for custom theme

I got this error

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'container', attribute 'htmlId': [facet 'pattern'] The value 'page-content inset' is not accepted by the pattern '[a-zA-Z][a-zA-Z\d-_:]*'. Line: 21

Element 'container', attribute htmlId: 'page-content inset' is not a valid value of the atomic type htmlIdentifierType. Line: 21

enter image description here

when I tried to set container with Id having space

enter image description here

I want to know how it's works.

it's work fine when i change id from page-content inset to page-content-inset

Was it helpful?

Solution

The value of the htmlId attribute must be matched by the regular expression [a-zA-Z][a-zA-Z\d-_:].

[a-zA-Z][a-zA-Z\d-_:] means

  • Start with a letter (uppercase or lowercase)
  • rest of the characters can be:
    • a letter (uppercase or lowercase)
    • a digit (0 to 9)
    • the character - (minus)
    • the character _ (underscore)
    • the character : (colon)

That's it. You are not allowed to have spaces (or any other characters except the ones above) inside an id.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top