Magento 2: Can't update product page layout in custom theme












4














(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.










share|improve this question
















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 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


















4














(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.










share|improve this question
















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 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
















4












4








4







(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.










share|improve this question















(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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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




















  • 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


















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












3 Answers
3






active

oldest

votes


















0














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.






share|improve this answer





















  • 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



















0














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!






share|improve this answer





























    -1














    Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.



    Edit the product






    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%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









      0














      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.






      share|improve this answer





















      • 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
















      0














      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.






      share|improve this answer





















      • 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














      0












      0








      0






      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.






      share|improve this answer












      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.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      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


















      • 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













      0














      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!






      share|improve this answer


























        0














        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!






        share|improve this answer
























          0












          0








          0






          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!






          share|improve this answer












          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!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 1 '16 at 11:24









          Makwana KetanMakwana Ketan

          1,177821




          1,177821























              -1














              Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.



              Edit the product






              share|improve this answer




























                -1














                Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.



                Edit the product






                share|improve this answer


























                  -1












                  -1








                  -1






                  Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.



                  Edit the product






                  share|improve this answer














                  Product Page layout in magento2 have to set from product. Edit the product from backend and set it to 1 column.



                  Edit the product







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Oct 20 '16 at 12:01









                  7ochem

                  5,72193668




                  5,72193668










                  answered Oct 20 '16 at 11:41









                  Ketan BoradaKetan Borada

                  1




                  1






























                      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.





                      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.




                      draft saved


                      draft discarded














                      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





















































                      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

                      An IMO inspired problem

                      Management

                      Investment