Move theme layout elements on a product view from within a Module Magento 2Is it possible to remove elements in a page layout in Magento2?magento 1.9x layout setting - single product pageMagento 2 - Can't access to products with direct urlMagento 2 Custom Page Layout Not WorkingMagento 2 : Display Related Products Block in Product ViewMagento 2 : How Edit Product Detail Page Layout - Luma Theme as ParentHow to load a layout XML file from a different pageUnable to create/visualize productsMagento 2.2 Theme LayoutHow do I display a custom grouped product page layout?
What are the ramifications of creating a homebrew world without an Astral Plane?
There is only s̶i̶x̶t̶y one place he can be
The baby cries all morning
At which point does a character regain all their Hit Dice?
Hide Select Output from T-SQL
Is there a good way to store credentials outside of a password manager?
Efficiently merge handle parallel feature branches in SFDX
Is exact Kanji stroke length important?
Can I Retrieve Email Addresses from BCC?
Why "be dealt cards" rather than "be dealing cards"?
Is there any reason not to eat food that's been dropped on the surface of the moon?
Lay out the Carpet
What is the oldest known work of fiction?
Do I need a multiple entry visa for a trip UK -> Sweden -> UK?
What's a natural way to say that someone works somewhere (for a job)?
Is the destination of a commercial flight important for the pilot?
How will losing mobility of one hand affect my career as a programmer?
Short story about space worker geeks who zone out by 'listening' to radiation from stars
Can somebody explain Brexit in a few child-proof sentences?
Applicability of Single Responsibility Principle
How can I get through very long and very dry, but also very useful technical documents when learning a new tool?
Print name if parameter passed to function
How was Earth single-handedly capable of creating 3 of the 4 gods of chaos?
Mapping a list into a phase plot
Move theme layout elements on a product view from within a Module Magento 2
Is it possible to remove elements in a page layout in Magento2?magento 1.9x layout setting - single product pageMagento 2 - Can't access to products with direct urlMagento 2 Custom Page Layout Not WorkingMagento 2 : Display Related Products Block in Product ViewMagento 2 : How Edit Product Detail Page Layout - Luma Theme as ParentHow to load a layout XML file from a different pageUnable to create/visualize productsMagento 2.2 Theme LayoutHow do I display a custom grouped product page layout?
I am having trouble moving the short description on the product page
. I tried with the move
command within the layout file
without any luck. I can move any new created block
where I want but I can't modify theme declared layout blocks
.
Location of my layout xml
file
Vendor/Module/view/frontend/layout/catalog_product_view.xml
Layout file code
<?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>
<referenceContainer name="content">
<block class="TestCatalogBlockRewriteProductView" name="product.seller.list" template="test.phtml" />
</referenceContainer>
<!--This works as created above-->
<move element="product.seller.list" destination="product.info.main" after="product.info.review"/>
<!--This does not work-->
<move element="product.info.overview" destination="product.info.main" after="-"/>
</body>
</page>
If I modify the theme layout file the move works. Any help will be great
product magento2.2 product-page page-layouts
add a comment |
I am having trouble moving the short description on the product page
. I tried with the move
command within the layout file
without any luck. I can move any new created block
where I want but I can't modify theme declared layout blocks
.
Location of my layout xml
file
Vendor/Module/view/frontend/layout/catalog_product_view.xml
Layout file code
<?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>
<referenceContainer name="content">
<block class="TestCatalogBlockRewriteProductView" name="product.seller.list" template="test.phtml" />
</referenceContainer>
<!--This works as created above-->
<move element="product.seller.list" destination="product.info.main" after="product.info.review"/>
<!--This does not work-->
<move element="product.info.overview" destination="product.info.main" after="-"/>
</body>
</page>
If I modify the theme layout file the move works. Any help will be great
product magento2.2 product-page page-layouts
add a comment |
I am having trouble moving the short description on the product page
. I tried with the move
command within the layout file
without any luck. I can move any new created block
where I want but I can't modify theme declared layout blocks
.
Location of my layout xml
file
Vendor/Module/view/frontend/layout/catalog_product_view.xml
Layout file code
<?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>
<referenceContainer name="content">
<block class="TestCatalogBlockRewriteProductView" name="product.seller.list" template="test.phtml" />
</referenceContainer>
<!--This works as created above-->
<move element="product.seller.list" destination="product.info.main" after="product.info.review"/>
<!--This does not work-->
<move element="product.info.overview" destination="product.info.main" after="-"/>
</body>
</page>
If I modify the theme layout file the move works. Any help will be great
product magento2.2 product-page page-layouts
I am having trouble moving the short description on the product page
. I tried with the move
command within the layout file
without any luck. I can move any new created block
where I want but I can't modify theme declared layout blocks
.
Location of my layout xml
file
Vendor/Module/view/frontend/layout/catalog_product_view.xml
Layout file code
<?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>
<referenceContainer name="content">
<block class="TestCatalogBlockRewriteProductView" name="product.seller.list" template="test.phtml" />
</referenceContainer>
<!--This works as created above-->
<move element="product.seller.list" destination="product.info.main" after="product.info.review"/>
<!--This does not work-->
<move element="product.info.overview" destination="product.info.main" after="-"/>
</body>
</page>
If I modify the theme layout file the move works. Any help will be great
product magento2.2 product-page page-layouts
product magento2.2 product-page page-layouts
edited 15 hours ago
Muhammad Hasham
2,7012731
2,7012731
asked Mar 18 at 14:53
mastermaster
163
163
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
product.info.overview
is generally the last element of the product.info.main
component. When you use after="-"
you're making if the last element of the product.info.main
component. I would try using before="-"
so that it becomes the first element in that component or so you can at least see it move. Then you can specify where you want it based on the M2 dev docs for layout updates (https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_mv).
Also, if you're not seeing changes you may need to clear your layout cache or recompile php bin/magento cache:flush layout
or php bin/magento setup:di:compile
.
That is correct, normally it is at the bottom however the theme we are using they moved it to the top and I would like to move it to the bottom.I tried the above and it is not working. I can move my element however not theproduct.info.overview
– master
Mar 19 at 11:33
I can however move theproduct.info.overview
when I extend the theme file however I would like to do this from my module
– master
Mar 19 at 11:35
Gotcha, that makes more sense. I believe that you’ll need to create a theme to go with your module and activate that theme. Because your other theme is active is not going to look at any of the layout files in your module.
– mlunt
Mar 19 at 11:50
So you are saying there is no way to move an element from the module? just to make sure I understand
– master
Mar 19 at 13:52
If you want to override as opposed to extend the path to the file needs to be different. It should be setup like this<theme_dir>/<Namespace_Module>/layout/override/theme/<Parent_Vendor>/<parent_theme>/catalog_product_view.xml
. Generally, the approach is to extend, but in your case you can override the base xml with this approach and not have to create a theme to override the parent theme. More details on overriding a layout file here: devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– mlunt
Mar 19 at 14:01
|
show 3 more comments
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%2f266385%2fmove-theme-layout-elements-on-a-product-view-from-within-a-module-magento-2%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
product.info.overview
is generally the last element of the product.info.main
component. When you use after="-"
you're making if the last element of the product.info.main
component. I would try using before="-"
so that it becomes the first element in that component or so you can at least see it move. Then you can specify where you want it based on the M2 dev docs for layout updates (https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_mv).
Also, if you're not seeing changes you may need to clear your layout cache or recompile php bin/magento cache:flush layout
or php bin/magento setup:di:compile
.
That is correct, normally it is at the bottom however the theme we are using they moved it to the top and I would like to move it to the bottom.I tried the above and it is not working. I can move my element however not theproduct.info.overview
– master
Mar 19 at 11:33
I can however move theproduct.info.overview
when I extend the theme file however I would like to do this from my module
– master
Mar 19 at 11:35
Gotcha, that makes more sense. I believe that you’ll need to create a theme to go with your module and activate that theme. Because your other theme is active is not going to look at any of the layout files in your module.
– mlunt
Mar 19 at 11:50
So you are saying there is no way to move an element from the module? just to make sure I understand
– master
Mar 19 at 13:52
If you want to override as opposed to extend the path to the file needs to be different. It should be setup like this<theme_dir>/<Namespace_Module>/layout/override/theme/<Parent_Vendor>/<parent_theme>/catalog_product_view.xml
. Generally, the approach is to extend, but in your case you can override the base xml with this approach and not have to create a theme to override the parent theme. More details on overriding a layout file here: devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– mlunt
Mar 19 at 14:01
|
show 3 more comments
product.info.overview
is generally the last element of the product.info.main
component. When you use after="-"
you're making if the last element of the product.info.main
component. I would try using before="-"
so that it becomes the first element in that component or so you can at least see it move. Then you can specify where you want it based on the M2 dev docs for layout updates (https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_mv).
Also, if you're not seeing changes you may need to clear your layout cache or recompile php bin/magento cache:flush layout
or php bin/magento setup:di:compile
.
That is correct, normally it is at the bottom however the theme we are using they moved it to the top and I would like to move it to the bottom.I tried the above and it is not working. I can move my element however not theproduct.info.overview
– master
Mar 19 at 11:33
I can however move theproduct.info.overview
when I extend the theme file however I would like to do this from my module
– master
Mar 19 at 11:35
Gotcha, that makes more sense. I believe that you’ll need to create a theme to go with your module and activate that theme. Because your other theme is active is not going to look at any of the layout files in your module.
– mlunt
Mar 19 at 11:50
So you are saying there is no way to move an element from the module? just to make sure I understand
– master
Mar 19 at 13:52
If you want to override as opposed to extend the path to the file needs to be different. It should be setup like this<theme_dir>/<Namespace_Module>/layout/override/theme/<Parent_Vendor>/<parent_theme>/catalog_product_view.xml
. Generally, the approach is to extend, but in your case you can override the base xml with this approach and not have to create a theme to override the parent theme. More details on overriding a layout file here: devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– mlunt
Mar 19 at 14:01
|
show 3 more comments
product.info.overview
is generally the last element of the product.info.main
component. When you use after="-"
you're making if the last element of the product.info.main
component. I would try using before="-"
so that it becomes the first element in that component or so you can at least see it move. Then you can specify where you want it based on the M2 dev docs for layout updates (https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_mv).
Also, if you're not seeing changes you may need to clear your layout cache or recompile php bin/magento cache:flush layout
or php bin/magento setup:di:compile
.
product.info.overview
is generally the last element of the product.info.main
component. When you use after="-"
you're making if the last element of the product.info.main
component. I would try using before="-"
so that it becomes the first element in that component or so you can at least see it move. Then you can specify where you want it based on the M2 dev docs for layout updates (https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_mv).
Also, if you're not seeing changes you may need to clear your layout cache or recompile php bin/magento cache:flush layout
or php bin/magento setup:di:compile
.
answered Mar 18 at 18:19
mluntmlunt
7619
7619
That is correct, normally it is at the bottom however the theme we are using they moved it to the top and I would like to move it to the bottom.I tried the above and it is not working. I can move my element however not theproduct.info.overview
– master
Mar 19 at 11:33
I can however move theproduct.info.overview
when I extend the theme file however I would like to do this from my module
– master
Mar 19 at 11:35
Gotcha, that makes more sense. I believe that you’ll need to create a theme to go with your module and activate that theme. Because your other theme is active is not going to look at any of the layout files in your module.
– mlunt
Mar 19 at 11:50
So you are saying there is no way to move an element from the module? just to make sure I understand
– master
Mar 19 at 13:52
If you want to override as opposed to extend the path to the file needs to be different. It should be setup like this<theme_dir>/<Namespace_Module>/layout/override/theme/<Parent_Vendor>/<parent_theme>/catalog_product_view.xml
. Generally, the approach is to extend, but in your case you can override the base xml with this approach and not have to create a theme to override the parent theme. More details on overriding a layout file here: devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– mlunt
Mar 19 at 14:01
|
show 3 more comments
That is correct, normally it is at the bottom however the theme we are using they moved it to the top and I would like to move it to the bottom.I tried the above and it is not working. I can move my element however not theproduct.info.overview
– master
Mar 19 at 11:33
I can however move theproduct.info.overview
when I extend the theme file however I would like to do this from my module
– master
Mar 19 at 11:35
Gotcha, that makes more sense. I believe that you’ll need to create a theme to go with your module and activate that theme. Because your other theme is active is not going to look at any of the layout files in your module.
– mlunt
Mar 19 at 11:50
So you are saying there is no way to move an element from the module? just to make sure I understand
– master
Mar 19 at 13:52
If you want to override as opposed to extend the path to the file needs to be different. It should be setup like this<theme_dir>/<Namespace_Module>/layout/override/theme/<Parent_Vendor>/<parent_theme>/catalog_product_view.xml
. Generally, the approach is to extend, but in your case you can override the base xml with this approach and not have to create a theme to override the parent theme. More details on overriding a layout file here: devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– mlunt
Mar 19 at 14:01
That is correct, normally it is at the bottom however the theme we are using they moved it to the top and I would like to move it to the bottom.I tried the above and it is not working. I can move my element however not the
product.info.overview
– master
Mar 19 at 11:33
That is correct, normally it is at the bottom however the theme we are using they moved it to the top and I would like to move it to the bottom.I tried the above and it is not working. I can move my element however not the
product.info.overview
– master
Mar 19 at 11:33
I can however move the
product.info.overview
when I extend the theme file however I would like to do this from my module– master
Mar 19 at 11:35
I can however move the
product.info.overview
when I extend the theme file however I would like to do this from my module– master
Mar 19 at 11:35
Gotcha, that makes more sense. I believe that you’ll need to create a theme to go with your module and activate that theme. Because your other theme is active is not going to look at any of the layout files in your module.
– mlunt
Mar 19 at 11:50
Gotcha, that makes more sense. I believe that you’ll need to create a theme to go with your module and activate that theme. Because your other theme is active is not going to look at any of the layout files in your module.
– mlunt
Mar 19 at 11:50
So you are saying there is no way to move an element from the module? just to make sure I understand
– master
Mar 19 at 13:52
So you are saying there is no way to move an element from the module? just to make sure I understand
– master
Mar 19 at 13:52
If you want to override as opposed to extend the path to the file needs to be different. It should be setup like this
<theme_dir>/<Namespace_Module>/layout/override/theme/<Parent_Vendor>/<parent_theme>/catalog_product_view.xml
. Generally, the approach is to extend, but in your case you can override the base xml with this approach and not have to create a theme to override the parent theme. More details on overriding a layout file here: devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…– mlunt
Mar 19 at 14:01
If you want to override as opposed to extend the path to the file needs to be different. It should be setup like this
<theme_dir>/<Namespace_Module>/layout/override/theme/<Parent_Vendor>/<parent_theme>/catalog_product_view.xml
. Generally, the approach is to extend, but in your case you can override the base xml with this approach and not have to create a theme to override the parent theme. More details on overriding a layout file here: devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…– mlunt
Mar 19 at 14:01
|
show 3 more comments
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.
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%2f266385%2fmove-theme-layout-elements-on-a-product-view-from-within-a-module-magento-2%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