3

i have created custom theme

/app/design/frontend/VendorName/ThemeName

It works fine. I see it in the admin, styles from it are applied, etc. But When I try to extend module layout Magento 2 don't see xml. I have created:

/app/design/frontend/VendorName/ThemeName/Magento_Catalog/layout/default.xml

wich contains:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="catalog.compare.sidebar" destination="sidebar.additional" after="-" />
    </body>
</page>

And there are no results at all. If I place this rule in

/vendor/magento/module-catalog/view/frontend/layout/default.xml

move works fine. But in custom theme xml just being ignored. I try to break it like

    <body

and page don't fail with error. So I think xmls from theme are ignored completely.

And yes, I

bin/magento cache:clean

before checking.

2

Look like I have find a reason: in the data base in table type of theme was 1, and other have 0. When I change type to 0 and php ./bin/magento cache:flush XML start to work properly. Lite googling show that there are Physical, Virtual, Staging types.

But I don't get why my custom theme was set to Virtual type (1?), Is there any way to set type other then with SQL UPDATE, and what is differences in types.

Would be grateful for any documentation links. Can't find anything official yet…

|improve this answer|||||
0

Have you try to redeploy the static content? Only clearing caching won't work if you haven't switched the deploy mode.

|improve this answer|||||
  • bin/magento setup:static-content:deploy ? Yes, sure, no help. But I don't really think that it was needed anyway. – SilentImp Feb 1 '17 at 10:06
  • That isn't needed if you're running in developer mode – Ben Crook Feb 1 '17 at 14:18
  • yep, developer mode it is. – SilentImp Feb 1 '17 at 15:11

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.