Devdocs: Misleading statements about theme's view.xml file

Created on 2 Dec 2019  路  5Comments  路  Source: magento/devdocs

Topic clarification/correction request

  • Misleading statements about theme's view.xml file

Topic Link

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-inherit.html#override-viewxml-file

Description

If you add the /etc/view.xml file in your theme, it overrides the parent鈥檚 file.

The above statement is incorrect with respect to the actual implementation of theme's view.xml file.

Possible solutions

N/A

Additional information

N/A

good first issue

Most helpful comment

@shrielenee Hi.

As mentioned here: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-inherit.html#override-viewxml-file

If your theme does not contain a view.xml configuration file, it will be inherited from the parent theme. If you add the <theme_dir>/etc/view.xml file in your theme, it overrides the parent鈥檚 file.

This means that the child theme's view.xml file overrides the parent theme's view.xml files. But in reality, the Child theme's view.xml actually extends parent themes view.xml(We only have to write needed changes here, other configurations will be inherited by fallback mechanism, Right?), does not override it.

Let me know if I understood wrong here.

Thanks!

All 5 comments

Hi @sanganinamrata Thanks for creating this issue. Could you explain how it would be better explained? What part is misleading?

Hey @sanganinamrata --- Any more info on this so we can begin work? Thanks!

P.S. Loved your Hackathon t-shirt tweet 馃槃

@shrielenee Great to hear that you recognized me馃槃And TYSM for the complement 馃槉

  • I'll revert back to you about in couple of hours.

Thanks!

@shrielenee Hi.

As mentioned here: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-inherit.html#override-viewxml-file

If your theme does not contain a view.xml configuration file, it will be inherited from the parent theme. If you add the <theme_dir>/etc/view.xml file in your theme, it overrides the parent鈥檚 file.

This means that the child theme's view.xml file overrides the parent theme's view.xml files. But in reality, the Child theme's view.xml actually extends parent themes view.xml(We only have to write needed changes here, other configurations will be inherited by fallback mechanism, Right?), does not override it.

Let me know if I understood wrong here.

Thanks!

That's great feedback! Thanks for the clarification.

Was this page helpful?
0 / 5 - 0 ratings