1

what is use of theme.xml file please explain briefly in magento 2 ?

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="logo"> <arguments> <argument name="logo_file" xsi:type="string">images/theme_logo.png</argument> <argument name="logo_img_width" xsi:type="number">300</argument> <argument name="logo_img_height" xsi:type="number">300</argument> </arguments> </referenceBlock> </body> </page>

    argument name="logo_img_height" xsi:type="number">300</argument> </arguments> </referenceBlock> </body> </page>

2 Answers 2

1

in Magento2 theme.xml contains basics configuration to create your theme. And the required field in this xml file is title and parent theme(the theme which you are considering as a parent, for example, blank,luma). Example of luma theme

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Magento Luma</title>
    <parent>Magento/blank</parent>
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

Here title is theme tile which you can find it from backend > content > Design > Themes

enter image description here

<parent> is your parent theme name and <preview_image> contains your theme's preview image which you can find it on your theme detail page,

enter image description here

0

Declaring Theme Logo

In the Magento application, the default format and name of a logo image is logo.svg. You can use a logo file with a different name and format, but you might need to declare it. You have to create a file default.xml in your theme’s layout directory and below code if you theme_logo.png is in size of 300×300:

Your Answer

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

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