From b493c355678d6c0072d009415f48c82e0918aead Mon Sep 17 00:00:00 2001 From: Bernhard Leers Date: Fri, 29 Sep 2023 14:33:13 +0200 Subject: [PATCH] add another section for preview image --- theme-development.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/theme-development.md b/theme-development.md index 5c810fa..2ecd4e3 100644 --- a/theme-development.md +++ b/theme-development.md @@ -59,10 +59,31 @@ ComponentRegistrar::register( ); ``` -4. To load the new theme, run the command `php bin/magento setup:upgrade`. +4. To load the new theme, run the command `bin/magento setup:upgrade`. Your custom theme is now ready to be customized and extended as per your requirements. +## Define a Preview Image (Optional) + +You can specify a preview image for your theme using the following XML configuration in your `theme.xml`: + +```xml + + MyTheme + Magento/blank + + media/preview.jpg + + +``` + +Ensure that the specified image file exists in your theme directory. If it doesn't, running `bin/magento setup:upgrade` will produce an error: + +``` +File "app/design/frontend/Acme/MyTheme/media/preview.jpg" does not exist. +``` + ## Theme Inheritance Magento 2 supports theme inheritance, allowing you to extend and customize existing themes. This reduces duplication and