CSS are compiled but not called in frontend












0















I added css on my website. One is bootstrap and one is a custom css.
I addedd it on my Magento_Theme folder (inside layout/default_head_block.xml)



<css src="css/bootstrap/css/bootstrap.css" order="100" />
<css src="css/reflexmania2-custom.css" order="100" />


suddenly there was a problem on these css. They are not loaded in the frontend css inside the HEAD tag.



i tried cleaning cache, generated folders, view_preprocessed and then running



setup:upgrade
setup:di:compile
setup:static-content:deploy


but nothing. they are not loaded.



they are compiled because i can see inside my pub/static folder.



i'm getting crazy. How can i solve this problem?



Thanks for help



EDIT: 1 --> added xml default_head_blocks.xml



 <?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">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>

<css src="css/bootstrap/css/bootstrap.css" order="100" />
<css src="https://use.fontawesome.com/releases/v5.4.1/css/all.css" src_type="url" order="100" />
<css src="css/reflexmania2-custom.css" order="100" />

</head>
</page>


Some notes: inside my Pub/static folder i have got all my css and layout.they are not working nor called from my theme. If i restore a previous version of my theme is the same. I think that there is some problem on pub static or some permission but i cannot understand where.



!(https://i.imgur.com/ZJalGjN.png)










share|improve this question

























  • Can you specify your CSS file path? Also please make sure that layout file name should be default_head_blocks.xml

    – Abhishek Panchal
    Jan 7 at 16:10













  • yes, i put css inside Theme/Module/web/css folder. I see that there is some xml errors because the theme is not loaded properly and my changes to the XML are not loaded properly. How can i debug the error?

    – Francesco
    Jan 7 at 16:19











  • Is your XML file name with blocks ? In your question, you mentioned block

    – Abhishek Panchal
    Jan 7 at 16:20













  • yes. the name is correct

    – Francesco
    Jan 7 at 16:27











  • Can you add the code of your entire XML file?

    – Abhishek Panchal
    Jan 7 at 16:33
















0















I added css on my website. One is bootstrap and one is a custom css.
I addedd it on my Magento_Theme folder (inside layout/default_head_block.xml)



<css src="css/bootstrap/css/bootstrap.css" order="100" />
<css src="css/reflexmania2-custom.css" order="100" />


suddenly there was a problem on these css. They are not loaded in the frontend css inside the HEAD tag.



i tried cleaning cache, generated folders, view_preprocessed and then running



setup:upgrade
setup:di:compile
setup:static-content:deploy


but nothing. they are not loaded.



they are compiled because i can see inside my pub/static folder.



i'm getting crazy. How can i solve this problem?



Thanks for help



EDIT: 1 --> added xml default_head_blocks.xml



 <?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">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>

<css src="css/bootstrap/css/bootstrap.css" order="100" />
<css src="https://use.fontawesome.com/releases/v5.4.1/css/all.css" src_type="url" order="100" />
<css src="css/reflexmania2-custom.css" order="100" />

</head>
</page>


Some notes: inside my Pub/static folder i have got all my css and layout.they are not working nor called from my theme. If i restore a previous version of my theme is the same. I think that there is some problem on pub static or some permission but i cannot understand where.



!(https://i.imgur.com/ZJalGjN.png)










share|improve this question

























  • Can you specify your CSS file path? Also please make sure that layout file name should be default_head_blocks.xml

    – Abhishek Panchal
    Jan 7 at 16:10













  • yes, i put css inside Theme/Module/web/css folder. I see that there is some xml errors because the theme is not loaded properly and my changes to the XML are not loaded properly. How can i debug the error?

    – Francesco
    Jan 7 at 16:19











  • Is your XML file name with blocks ? In your question, you mentioned block

    – Abhishek Panchal
    Jan 7 at 16:20













  • yes. the name is correct

    – Francesco
    Jan 7 at 16:27











  • Can you add the code of your entire XML file?

    – Abhishek Panchal
    Jan 7 at 16:33














0












0








0








I added css on my website. One is bootstrap and one is a custom css.
I addedd it on my Magento_Theme folder (inside layout/default_head_block.xml)



<css src="css/bootstrap/css/bootstrap.css" order="100" />
<css src="css/reflexmania2-custom.css" order="100" />


suddenly there was a problem on these css. They are not loaded in the frontend css inside the HEAD tag.



i tried cleaning cache, generated folders, view_preprocessed and then running



setup:upgrade
setup:di:compile
setup:static-content:deploy


but nothing. they are not loaded.



they are compiled because i can see inside my pub/static folder.



i'm getting crazy. How can i solve this problem?



Thanks for help



EDIT: 1 --> added xml default_head_blocks.xml



 <?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">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>

<css src="css/bootstrap/css/bootstrap.css" order="100" />
<css src="https://use.fontawesome.com/releases/v5.4.1/css/all.css" src_type="url" order="100" />
<css src="css/reflexmania2-custom.css" order="100" />

</head>
</page>


Some notes: inside my Pub/static folder i have got all my css and layout.they are not working nor called from my theme. If i restore a previous version of my theme is the same. I think that there is some problem on pub static or some permission but i cannot understand where.



!(https://i.imgur.com/ZJalGjN.png)










share|improve this question
















I added css on my website. One is bootstrap and one is a custom css.
I addedd it on my Magento_Theme folder (inside layout/default_head_block.xml)



<css src="css/bootstrap/css/bootstrap.css" order="100" />
<css src="css/reflexmania2-custom.css" order="100" />


suddenly there was a problem on these css. They are not loaded in the frontend css inside the HEAD tag.



i tried cleaning cache, generated folders, view_preprocessed and then running



setup:upgrade
setup:di:compile
setup:static-content:deploy


but nothing. they are not loaded.



they are compiled because i can see inside my pub/static folder.



i'm getting crazy. How can i solve this problem?



Thanks for help



EDIT: 1 --> added xml default_head_blocks.xml



 <?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">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>

<css src="css/bootstrap/css/bootstrap.css" order="100" />
<css src="https://use.fontawesome.com/releases/v5.4.1/css/all.css" src_type="url" order="100" />
<css src="css/reflexmania2-custom.css" order="100" />

</head>
</page>


Some notes: inside my Pub/static folder i have got all my css and layout.they are not working nor called from my theme. If i restore a previous version of my theme is the same. I think that there is some problem on pub static or some permission but i cannot understand where.



!(https://i.imgur.com/ZJalGjN.png)







magento2 css frontend cache less






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 7 at 17:56







Francesco

















asked Jan 7 at 15:46









FrancescoFrancesco

65




65













  • Can you specify your CSS file path? Also please make sure that layout file name should be default_head_blocks.xml

    – Abhishek Panchal
    Jan 7 at 16:10













  • yes, i put css inside Theme/Module/web/css folder. I see that there is some xml errors because the theme is not loaded properly and my changes to the XML are not loaded properly. How can i debug the error?

    – Francesco
    Jan 7 at 16:19











  • Is your XML file name with blocks ? In your question, you mentioned block

    – Abhishek Panchal
    Jan 7 at 16:20













  • yes. the name is correct

    – Francesco
    Jan 7 at 16:27











  • Can you add the code of your entire XML file?

    – Abhishek Panchal
    Jan 7 at 16:33



















  • Can you specify your CSS file path? Also please make sure that layout file name should be default_head_blocks.xml

    – Abhishek Panchal
    Jan 7 at 16:10













  • yes, i put css inside Theme/Module/web/css folder. I see that there is some xml errors because the theme is not loaded properly and my changes to the XML are not loaded properly. How can i debug the error?

    – Francesco
    Jan 7 at 16:19











  • Is your XML file name with blocks ? In your question, you mentioned block

    – Abhishek Panchal
    Jan 7 at 16:20













  • yes. the name is correct

    – Francesco
    Jan 7 at 16:27











  • Can you add the code of your entire XML file?

    – Abhishek Panchal
    Jan 7 at 16:33

















Can you specify your CSS file path? Also please make sure that layout file name should be default_head_blocks.xml

– Abhishek Panchal
Jan 7 at 16:10







Can you specify your CSS file path? Also please make sure that layout file name should be default_head_blocks.xml

– Abhishek Panchal
Jan 7 at 16:10















yes, i put css inside Theme/Module/web/css folder. I see that there is some xml errors because the theme is not loaded properly and my changes to the XML are not loaded properly. How can i debug the error?

– Francesco
Jan 7 at 16:19





yes, i put css inside Theme/Module/web/css folder. I see that there is some xml errors because the theme is not loaded properly and my changes to the XML are not loaded properly. How can i debug the error?

– Francesco
Jan 7 at 16:19













Is your XML file name with blocks ? In your question, you mentioned block

– Abhishek Panchal
Jan 7 at 16:20







Is your XML file name with blocks ? In your question, you mentioned block

– Abhishek Panchal
Jan 7 at 16:20















yes. the name is correct

– Francesco
Jan 7 at 16:27





yes. the name is correct

– Francesco
Jan 7 at 16:27













Can you add the code of your entire XML file?

– Abhishek Panchal
Jan 7 at 16:33





Can you add the code of your entire XML file?

– Abhishek Panchal
Jan 7 at 16:33










2 Answers
2






active

oldest

votes


















0














First, there is no order property, with this you should have an Exception (property not valid).



To add css :




app/design/frontend/{Vendor}/{themename}/Magento_Theme/layout/default_head_blocks.xml




<?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">
<head>
<css src="css/bootstrap/css/bootstrap.css" />
<css src="css/reflexmania2-custom.css" />
</head>
</page>



app/design/frontend/{Vendor}/{themename}/web/css/bootstrap.css




/*Some content*/



app/design/frontend/{Vendor}/{themename}/web/css/reflexmania2-custom.css




/*Some content*/


Then execute : php bin/magento setup:static-content:deploy -f






share|improve this answer
























  • no. nothing solved. i tried switching databases with one website that it's working and this solved the problem. i think there is something inside the database or inside the pub static folder that it's not loaded properlu

    – Francesco
    Jan 8 at 8:40











  • maybe there is some problem on the pub static folder or some htaccess...

    – Francesco
    Jan 8 at 9:38



















0














solved this problem.
I don't know how but something changed my theme from phisical to virtual on my db table 'themes'.
Just changed the value from 0 -> 1 and all works without problems.



this looks like a problem of magento2 and virtual themes is not completely developed:
Magento 2 - Theme Type 0:physical, 1:virtual, 2:staging. When to use?






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "479"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f257008%2fcss-are-compiled-but-not-called-in-frontend%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    First, there is no order property, with this you should have an Exception (property not valid).



    To add css :




    app/design/frontend/{Vendor}/{themename}/Magento_Theme/layout/default_head_blocks.xml




    <?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">
    <head>
    <css src="css/bootstrap/css/bootstrap.css" />
    <css src="css/reflexmania2-custom.css" />
    </head>
    </page>



    app/design/frontend/{Vendor}/{themename}/web/css/bootstrap.css




    /*Some content*/



    app/design/frontend/{Vendor}/{themename}/web/css/reflexmania2-custom.css




    /*Some content*/


    Then execute : php bin/magento setup:static-content:deploy -f






    share|improve this answer
























    • no. nothing solved. i tried switching databases with one website that it's working and this solved the problem. i think there is something inside the database or inside the pub static folder that it's not loaded properlu

      – Francesco
      Jan 8 at 8:40











    • maybe there is some problem on the pub static folder or some htaccess...

      – Francesco
      Jan 8 at 9:38
















    0














    First, there is no order property, with this you should have an Exception (property not valid).



    To add css :




    app/design/frontend/{Vendor}/{themename}/Magento_Theme/layout/default_head_blocks.xml




    <?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">
    <head>
    <css src="css/bootstrap/css/bootstrap.css" />
    <css src="css/reflexmania2-custom.css" />
    </head>
    </page>



    app/design/frontend/{Vendor}/{themename}/web/css/bootstrap.css




    /*Some content*/



    app/design/frontend/{Vendor}/{themename}/web/css/reflexmania2-custom.css




    /*Some content*/


    Then execute : php bin/magento setup:static-content:deploy -f






    share|improve this answer
























    • no. nothing solved. i tried switching databases with one website that it's working and this solved the problem. i think there is something inside the database or inside the pub static folder that it's not loaded properlu

      – Francesco
      Jan 8 at 8:40











    • maybe there is some problem on the pub static folder or some htaccess...

      – Francesco
      Jan 8 at 9:38














    0












    0








    0







    First, there is no order property, with this you should have an Exception (property not valid).



    To add css :




    app/design/frontend/{Vendor}/{themename}/Magento_Theme/layout/default_head_blocks.xml




    <?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">
    <head>
    <css src="css/bootstrap/css/bootstrap.css" />
    <css src="css/reflexmania2-custom.css" />
    </head>
    </page>



    app/design/frontend/{Vendor}/{themename}/web/css/bootstrap.css




    /*Some content*/



    app/design/frontend/{Vendor}/{themename}/web/css/reflexmania2-custom.css




    /*Some content*/


    Then execute : php bin/magento setup:static-content:deploy -f






    share|improve this answer













    First, there is no order property, with this you should have an Exception (property not valid).



    To add css :




    app/design/frontend/{Vendor}/{themename}/Magento_Theme/layout/default_head_blocks.xml




    <?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">
    <head>
    <css src="css/bootstrap/css/bootstrap.css" />
    <css src="css/reflexmania2-custom.css" />
    </head>
    </page>



    app/design/frontend/{Vendor}/{themename}/web/css/bootstrap.css




    /*Some content*/



    app/design/frontend/{Vendor}/{themename}/web/css/reflexmania2-custom.css




    /*Some content*/


    Then execute : php bin/magento setup:static-content:deploy -f







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 7 at 20:39









    PЯINCƏPЯINCƏ

    7,76131137




    7,76131137













    • no. nothing solved. i tried switching databases with one website that it's working and this solved the problem. i think there is something inside the database or inside the pub static folder that it's not loaded properlu

      – Francesco
      Jan 8 at 8:40











    • maybe there is some problem on the pub static folder or some htaccess...

      – Francesco
      Jan 8 at 9:38



















    • no. nothing solved. i tried switching databases with one website that it's working and this solved the problem. i think there is something inside the database or inside the pub static folder that it's not loaded properlu

      – Francesco
      Jan 8 at 8:40











    • maybe there is some problem on the pub static folder or some htaccess...

      – Francesco
      Jan 8 at 9:38

















    no. nothing solved. i tried switching databases with one website that it's working and this solved the problem. i think there is something inside the database or inside the pub static folder that it's not loaded properlu

    – Francesco
    Jan 8 at 8:40





    no. nothing solved. i tried switching databases with one website that it's working and this solved the problem. i think there is something inside the database or inside the pub static folder that it's not loaded properlu

    – Francesco
    Jan 8 at 8:40













    maybe there is some problem on the pub static folder or some htaccess...

    – Francesco
    Jan 8 at 9:38





    maybe there is some problem on the pub static folder or some htaccess...

    – Francesco
    Jan 8 at 9:38













    0














    solved this problem.
    I don't know how but something changed my theme from phisical to virtual on my db table 'themes'.
    Just changed the value from 0 -> 1 and all works without problems.



    this looks like a problem of magento2 and virtual themes is not completely developed:
    Magento 2 - Theme Type 0:physical, 1:virtual, 2:staging. When to use?






    share|improve this answer




























      0














      solved this problem.
      I don't know how but something changed my theme from phisical to virtual on my db table 'themes'.
      Just changed the value from 0 -> 1 and all works without problems.



      this looks like a problem of magento2 and virtual themes is not completely developed:
      Magento 2 - Theme Type 0:physical, 1:virtual, 2:staging. When to use?






      share|improve this answer


























        0












        0








        0







        solved this problem.
        I don't know how but something changed my theme from phisical to virtual on my db table 'themes'.
        Just changed the value from 0 -> 1 and all works without problems.



        this looks like a problem of magento2 and virtual themes is not completely developed:
        Magento 2 - Theme Type 0:physical, 1:virtual, 2:staging. When to use?






        share|improve this answer













        solved this problem.
        I don't know how but something changed my theme from phisical to virtual on my db table 'themes'.
        Just changed the value from 0 -> 1 and all works without problems.



        this looks like a problem of magento2 and virtual themes is not completely developed:
        Magento 2 - Theme Type 0:physical, 1:virtual, 2:staging. When to use?







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 38 mins ago









        FrancescoFrancesco

        65




        65






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f257008%2fcss-are-compiled-but-not-called-in-frontend%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Magento 2 controller redirect on button click in phtml file

            Polycentropodidae