Magento 2: Can't update product page layout in custom theme
(heavily modified the question for simplicity and clarity)
As a test case I created <custom-theme>/Magento_Theme/layout/default_head_blocks.xml
. Creating and modifying this file, according to the docs, should effect every page.
In my extended default_head_blocks.xml
I added a bogus JS, just to see what pages it will be added to.
<?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>
<script src="js/test-file.js"/>
</head>
</page>
I can see test-file.js
on category and CMS pages, but not on a product page.
In fact, I can't get any layout updates to have an effect on the product page. The product page has the inherited theme Magento Blank
, plus my site logo, located in <theme-dir>/web/imges/logo.svg
.
Any guidance on this issue would be appreciated.
magento2 theme
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
(heavily modified the question for simplicity and clarity)
As a test case I created <custom-theme>/Magento_Theme/layout/default_head_blocks.xml
. Creating and modifying this file, according to the docs, should effect every page.
In my extended default_head_blocks.xml
I added a bogus JS, just to see what pages it will be added to.
<?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>
<script src="js/test-file.js"/>
</head>
</page>
I can see test-file.js
on category and CMS pages, but not on a product page.
In fact, I can't get any layout updates to have an effect on the product page. The product page has the inherited theme Magento Blank
, plus my site logo, located in <theme-dir>/web/imges/logo.svg
.
Any guidance on this issue would be appreciated.
magento2 theme
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Please review the documentation and let us know if it's helpful or not.
– Steve Johnson
Jan 16 '16 at 15:14
Hi, if you'll provide your layout XML here, we can help you. Thanks
– Steve Johnson
Jan 18 '16 at 15:56
Take a theme based on Magento Blank, and createapp/design/frontend/Vendor/theme/Magento_Catalog/layout/catalog_product_view.xml
and create<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="page.main.title" destination="product.info.main" after="-"/> </body> </page>
and nothing changes
– andyjv
Jan 18 '16 at 16:19
add a comment |
(heavily modified the question for simplicity and clarity)
As a test case I created <custom-theme>/Magento_Theme/layout/default_head_blocks.xml
. Creating and modifying this file, according to the docs, should effect every page.
In my extended default_head_blocks.xml
I added a bogus JS, just to see what pages it will be added to.
<?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>
<script src="js/test-file.js"/>
</head>
</page>
I can see test-file.js
on category and CMS pages, but not on a product page.
In fact, I can't get any layout updates to have an effect on the product page. The product page has the inherited theme Magento Blank
, plus my site logo, located in <theme-dir>/web/imges/logo.svg
.
Any guidance on this issue would be appreciated.
magento2 theme
(heavily modified the question for simplicity and clarity)
As a test case I created <custom-theme>/Magento_Theme/layout/default_head_blocks.xml
. Creating and modifying this file, according to the docs, should effect every page.
In my extended default_head_blocks.xml
I added a bogus JS, just to see what pages it will be added to.
<?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>
<script src="js/test-file.js"/>
</head>
</page>
I can see test-file.js
on category and CMS pages, but not on a product page.
In fact, I can't get any layout updates to have an effect on the product page. The product page has the inherited theme Magento Blank
, plus my site logo, located in <theme-dir>/web/imges/logo.svg
.
Any guidance on this issue would be appreciated.
magento2 theme
magento2 theme
edited Jan 19 '16 at 16:53
andyjv
asked Jan 15 '16 at 13:48
andyjvandyjv
1,96511740
1,96511740
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Please review the documentation and let us know if it's helpful or not.
– Steve Johnson
Jan 16 '16 at 15:14
Hi, if you'll provide your layout XML here, we can help you. Thanks
– Steve Johnson
Jan 18 '16 at 15:56
Take a theme based on Magento Blank, and createapp/design/frontend/Vendor/theme/Magento_Catalog/layout/catalog_product_view.xml
and create<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="page.main.title" destination="product.info.main" after="-"/> </body> </page>
and nothing changes
– andyjv
Jan 18 '16 at 16:19
add a comment |
Please review the documentation and let us know if it's helpful or not.
– Steve Johnson
Jan 16 '16 at 15:14
Hi, if you'll provide your layout XML here, we can help you. Thanks
– Steve Johnson
Jan 18 '16 at 15:56
Take a theme based on Magento Blank, and createapp/design/frontend/Vendor/theme/Magento_Catalog/layout/catalog_product_view.xml
and create<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="page.main.title" destination="product.info.main" after="-"/> </body> </page>
and nothing changes
– andyjv
Jan 18 '16 at 16:19
Please review the documentation and let us know if it's helpful or not.
– Steve Johnson
Jan 16 '16 at 15:14
Please review the documentation and let us know if it's helpful or not.
– Steve Johnson
Jan 16 '16 at 15:14
Hi, if you'll provide your layout XML here, we can help you. Thanks
– Steve Johnson
Jan 18 '16 at 15:56
Hi, if you'll provide your layout XML here, we can help you. Thanks
– Steve Johnson
Jan 18 '16 at 15:56
Take a theme based on Magento Blank, and create
app/design/frontend/Vendor/theme/Magento_Catalog/layout/catalog_product_view.xml
and create <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="page.main.title" destination="product.info.main" after="-"/> </body> </page>
and nothing changes– andyjv
Jan 18 '16 at 16:19
Take a theme based on Magento Blank, and create
app/design/frontend/Vendor/theme/Magento_Catalog/layout/catalog_product_view.xml
and create <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="page.main.title" destination="product.info.main" after="-"/> </body> </page>
and nothing changes– andyjv
Jan 18 '16 at 16:19
add a comment |
3 Answers
3
active
oldest
votes
There was similar issue with a custom layout file not being applied:
https://github.com/magento/magento2/issues/2996
One of the community members solved an issue with custom layout file not being applied by changing line endings to unix and encoding to utf8 in his custom layout.
Great suggestion, but best I can tell, my files are utf-8 encoded and use unix line endings. I am developing on MAMP.
– andyjv
Jan 22 '16 at 19:16
add a comment |
Just create the composer.json in your theme if not created yet.
{
"name": "vendor_name/theme_name",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/theme-frontend-blank": "100.0.*",
"magento/framework": "100.0.*"
},
"type": "magento2-theme",
"version": "2.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
]
}
}
Then run below command
php bin/magento setup:upgrade
Hope it helps you!
add a comment |
Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.
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%2f97395%2fmagento-2-cant-update-product-page-layout-in-custom-theme%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
There was similar issue with a custom layout file not being applied:
https://github.com/magento/magento2/issues/2996
One of the community members solved an issue with custom layout file not being applied by changing line endings to unix and encoding to utf8 in his custom layout.
Great suggestion, but best I can tell, my files are utf-8 encoded and use unix line endings. I am developing on MAMP.
– andyjv
Jan 22 '16 at 19:16
add a comment |
There was similar issue with a custom layout file not being applied:
https://github.com/magento/magento2/issues/2996
One of the community members solved an issue with custom layout file not being applied by changing line endings to unix and encoding to utf8 in his custom layout.
Great suggestion, but best I can tell, my files are utf-8 encoded and use unix line endings. I am developing on MAMP.
– andyjv
Jan 22 '16 at 19:16
add a comment |
There was similar issue with a custom layout file not being applied:
https://github.com/magento/magento2/issues/2996
One of the community members solved an issue with custom layout file not being applied by changing line endings to unix and encoding to utf8 in his custom layout.
There was similar issue with a custom layout file not being applied:
https://github.com/magento/magento2/issues/2996
One of the community members solved an issue with custom layout file not being applied by changing line endings to unix and encoding to utf8 in his custom layout.
answered Jan 22 '16 at 13:43
AlexAlex
42936
42936
Great suggestion, but best I can tell, my files are utf-8 encoded and use unix line endings. I am developing on MAMP.
– andyjv
Jan 22 '16 at 19:16
add a comment |
Great suggestion, but best I can tell, my files are utf-8 encoded and use unix line endings. I am developing on MAMP.
– andyjv
Jan 22 '16 at 19:16
Great suggestion, but best I can tell, my files are utf-8 encoded and use unix line endings. I am developing on MAMP.
– andyjv
Jan 22 '16 at 19:16
Great suggestion, but best I can tell, my files are utf-8 encoded and use unix line endings. I am developing on MAMP.
– andyjv
Jan 22 '16 at 19:16
add a comment |
Just create the composer.json in your theme if not created yet.
{
"name": "vendor_name/theme_name",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/theme-frontend-blank": "100.0.*",
"magento/framework": "100.0.*"
},
"type": "magento2-theme",
"version": "2.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
]
}
}
Then run below command
php bin/magento setup:upgrade
Hope it helps you!
add a comment |
Just create the composer.json in your theme if not created yet.
{
"name": "vendor_name/theme_name",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/theme-frontend-blank": "100.0.*",
"magento/framework": "100.0.*"
},
"type": "magento2-theme",
"version": "2.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
]
}
}
Then run below command
php bin/magento setup:upgrade
Hope it helps you!
add a comment |
Just create the composer.json in your theme if not created yet.
{
"name": "vendor_name/theme_name",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/theme-frontend-blank": "100.0.*",
"magento/framework": "100.0.*"
},
"type": "magento2-theme",
"version": "2.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
]
}
}
Then run below command
php bin/magento setup:upgrade
Hope it helps you!
Just create the composer.json in your theme if not created yet.
{
"name": "vendor_name/theme_name",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/theme-frontend-blank": "100.0.*",
"magento/framework": "100.0.*"
},
"type": "magento2-theme",
"version": "2.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
]
}
}
Then run below command
php bin/magento setup:upgrade
Hope it helps you!
answered Sep 1 '16 at 11:24
Makwana KetanMakwana Ketan
1,177821
1,177821
add a comment |
add a comment |
Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.
add a comment |
Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.
add a comment |
Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.
Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.
edited Oct 20 '16 at 12:01
7ochem
5,72193668
5,72193668
answered Oct 20 '16 at 11:41
Ketan BoradaKetan Borada
1
1
add a comment |
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%2f97395%2fmagento-2-cant-update-product-page-layout-in-custom-theme%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
Please review the documentation and let us know if it's helpful or not.
– Steve Johnson
Jan 16 '16 at 15:14
Hi, if you'll provide your layout XML here, we can help you. Thanks
– Steve Johnson
Jan 18 '16 at 15:56
Take a theme based on Magento Blank, and create
app/design/frontend/Vendor/theme/Magento_Catalog/layout/catalog_product_view.xml
and create<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="page.main.title" destination="product.info.main" after="-"/> </body> </page>
and nothing changes– andyjv
Jan 18 '16 at 16:19