0

I am having issues with my Magento 2 store not displaying products at all on a new theme I created that inherits from the Magento/luma theme.

Where the product block is suppose to be displayed on my main page, this is displayed, (also in the single product category that exists, this message is displayed)

We're sorry, an error has occurred while generating this content.

Below is my error I am getting for my view.xml file

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid XML in file /home/madhatte/public_html/store/app/design/frontend/Madhatters/m2-theme/etc/view.xml:
Element 'media': No matching global declaration available for the validation root.
Line: 2


Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid XML in file /home/madhatte/public_html/store/app/design/frontend/Madhatters/m2-theme/etc/view.xml:
Element 'media': No matching global declaration available for the validation root.

Below is my view.xml file:

<media>
    <images module="Magento_Catalog">
        <image id="category_page_grid" type="small_image">
            <width>350</width>
            <height>350</height>
        </image>
    </images>
</media>

I don't believe it is just the media tag solely throwing the error. I have tried removing it, adding it, and adding other lines to try and see what is wrong with view.xml.

1

As i can see, there in no line with view element at the top of file. Look at the correct example

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <media>
        <images module="Magento_Catalog">
            <image id="test" type="thumbnail">
                <width>327</width>
                <height>408</height>
            </image>
        </images>
    </media>
</view>
| improve this answer | |
  • I added in the view element to the file, which I added before. It literally removed all styling that existed from the luma theme I was inheriting from though. Not super sure where to go from here now. When I throw it into developer mode and check for more errors, I get nothing. – Ryan L Nov 15 '18 at 15:53

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.