0

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

1
  • yes we should not use space in ID Commented Jun 6, 2018 at 10:28

1 Answer 1

3

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.