0

Tried to install a store locator extension.

When go to the front end producing this error.

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ). Line: 708

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ). Line: 708

0 D:\xampp\htdocs\tork\vendor\magento\framework\Config\Dom.php(115): Magento\Framework\Config\Dom->_initDom(' 1D:\xampp\htdocs\tork\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(111): Magento\Framework\Config\Dom->__construct('

How can i fix this issue?. Magento version 2.2.2

2

most probably you have in one of your layout files a <block> tag inside the <head> tag.
The <head> tag does not support block child elements.
See the xsd validation schema for head section: https://github.com/magento/magento2/blob/2.2-develop/lib/internal/Magento/Framework/View/Layout/etc/head.xsd#L51

If your next question is, "But I need to add a block to my head section. how do I do that?" then you can check this: Magento 2: Adding Arbitrary HTML to the <head> of Every Page?

  • 1
    Oh yeah....or the other way around. Didn't think this could be :) – Marius Mar 26 '18 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.