CSS are compiled but not called in frontend
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
|
show 3 more comments
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
Can you specify your CSS file path? Also please make sure that layout file name should bedefault_head_blocks.xml
– Abhishek Panchal
yesterday
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
yesterday
Is your XML file name withblocks
? In your question, you mentioned block
– Abhishek Panchal
yesterday
yes. the name is correct
– Francesco
yesterday
Can you add the code of your entire XML file?
– Abhishek Panchal
yesterday
|
show 3 more comments
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
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
magento2 css frontend cache less
edited yesterday
Francesco
asked yesterday
FrancescoFrancesco
65
65
Can you specify your CSS file path? Also please make sure that layout file name should bedefault_head_blocks.xml
– Abhishek Panchal
yesterday
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
yesterday
Is your XML file name withblocks
? In your question, you mentioned block
– Abhishek Panchal
yesterday
yes. the name is correct
– Francesco
yesterday
Can you add the code of your entire XML file?
– Abhishek Panchal
yesterday
|
show 3 more comments
Can you specify your CSS file path? Also please make sure that layout file name should bedefault_head_blocks.xml
– Abhishek Panchal
yesterday
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
yesterday
Is your XML file name withblocks
? In your question, you mentioned block
– Abhishek Panchal
yesterday
yes. the name is correct
– Francesco
yesterday
Can you add the code of your entire XML file?
– Abhishek Panchal
yesterday
Can you specify your CSS file path? Also please make sure that layout file name should be
default_head_blocks.xml
– Abhishek Panchal
yesterday
Can you specify your CSS file path? Also please make sure that layout file name should be
default_head_blocks.xml
– Abhishek Panchal
yesterday
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
yesterday
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
yesterday
Is your XML file name with
blocks
? In your question, you mentioned block– Abhishek Panchal
yesterday
Is your XML file name with
blocks
? In your question, you mentioned block– Abhishek Panchal
yesterday
yes. the name is correct
– Francesco
yesterday
yes. the name is correct
– Francesco
yesterday
Can you add the code of your entire XML file?
– Abhishek Panchal
yesterday
Can you add the code of your entire XML file?
– Abhishek Panchal
yesterday
|
show 3 more comments
1 Answer
1
active
oldest
votes
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
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
21 hours ago
maybe there is some problem on the pub static folder or some htaccess...
– Francesco
20 hours ago
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
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
21 hours ago
maybe there is some problem on the pub static folder or some htaccess...
– Francesco
20 hours ago
add a comment |
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
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
21 hours ago
maybe there is some problem on the pub static folder or some htaccess...
– Francesco
20 hours ago
add a comment |
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
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
answered yesterday
PЯINCƏPЯINCƏ
7,75121136
7,75121136
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
21 hours ago
maybe there is some problem on the pub static folder or some htaccess...
– Francesco
20 hours ago
add a comment |
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
21 hours ago
maybe there is some problem on the pub static folder or some htaccess...
– Francesco
20 hours ago
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
21 hours ago
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
21 hours ago
maybe there is some problem on the pub static folder or some htaccess...
– Francesco
20 hours ago
maybe there is some problem on the pub static folder or some htaccess...
– Francesco
20 hours ago
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Can you specify your CSS file path? Also please make sure that layout file name should be
default_head_blocks.xml
– Abhishek Panchal
yesterday
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
yesterday
Is your XML file name with
blocks
? In your question, you mentioned block– Abhishek Panchal
yesterday
yes. the name is correct
– Francesco
yesterday
Can you add the code of your entire XML file?
– Abhishek Panchal
yesterday