Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [layout]

Denotes the xml files used to define the block hierarchy which eventually renders the template files.

9
votes
0answers
765 views

Magento2: Conditionally replace block template and class the right way

This rather trivial requirement turns out be quite a pain for us in recent days, as we couldn't find a satisfying existing solution, yet. The Task We are trying to replace certain blocks with a ...
6
votes
0answers
186 views

Header and footer in an external file

I'm using an index.php file under /pub/custom folder, which is used to create custom designs. This file is completely written in html and javascript. Is there any way to include current theme ...
6
votes
0answers
682 views

Magento 2 - Move the afterMethods item (Discount and Gift Card Code) to the Order Summary sidebar

I would like to move the afterMethods xml item which contains the Discount Code and Gift Card code under the billing-step in the module-checkout/view/frontend/web/checkout_index_index.xml so that it ...
5
votes
0answers
106 views

Remove Trailing Slash from Footer Links added via addLink

I have added several links in my layout.xml like this: <action method="addLink" translate="label title"> <label>XYZ</label> <url>xyz</url> <title>...
5
votes
0answers
397 views

Magento 2: How to override cacheable=“false” in layout in your own theme

We use a third party extension wich lets us add bundles with specific discounts to product pages. The problem is that they added a default.xml with the following code: <block class="Magedelight\...
5
votes
0answers
899 views

Magento 2 - Move Category Page Toolbar/Sorting Options Above Both Columns

What I'm trying to do is move the toolbar/sorting options on the category page above the left column and right column so it spans the full width of my content area. I'm trying everything and nothing ...
5
votes
0answers
2k views

Magento 2: changing custom theme default layout

I have custom theme that inherits no parent theme from Magento. The default layout appears to be 1column, and I am able to make modifications to that column in my custom theme's layout\default.xml ...
5
votes
0answers
1k views

After assign custom home page layout getting blank page in Magento2

Magento2 by default provide 1column, 2columns-left, 2columns-right, 3columns layout and I want to set new layout for my Homepage so I do below process. First copy 2 files from this path 1. ...
4
votes
0answers
284 views

How to ignore(remove) <update handle=“name” added in other layout

module-sales/view/frontend/layout/sales_order_view.xml has following code: <update handle="sales_order_info_links"/> Is there any pretty way to remove such updates? p.s. I know about ...
3
votes
0answers
50 views

Product's “Layout Update XML” code disappears from the site every 24 hours

I have some products with "Layout Update XML" Design updates (simple XML pointing to a template file; very basic and in the correct format). Every 24 hours after a cache flush, the code vanishes from ...
3
votes
0answers
62 views

How to make 4 column layout file in magento

I want to make custom layout like 4 column to show on front end. it gives default 1 column ,2 columns with right bar,2 columns with right bar and 3 columns. which types of changes in xml file??
3
votes
0answers
147 views

Show all products with layered navigation Magento 2

Now, to be able to show all the products, I have to make 1 main parent category to contain all the product category, but I think it's not the right thing to do. Is there a page to show all the ...
3
votes
0answers
30 views

How to insert create customer account form layout to a block as a widget

I want to insert customer_account_create.xml content which containing the create customer account form into one of my block that I created from backend > content > blocks > add new block Is there ...
3
votes
0answers
65 views

Check if block is called in phtml file

Is it possible to check in default.phtml file (app\design\frontend\MyNAMESpace\MY_THEME\Magento_Catalog\templates\product\price\amount\default.phtml) that catalog.product.related (block ) is loaded or ...
3
votes
0answers
367 views

Magento 2: Include header and footer in external php

I want to include header and footer layout of Magento 2 to external PHP file, I am using my own code(external PHP) to make a frontend page. how to add header and footer layout theme in Magento 2 to my ...
3
votes
0answers
575 views

Magento 2 - Display subcategories above product listing

I'm trying to display the first 8 subcategories above the product listing on a select few category pages. I know that I can easily do this using static blocks, but I'd rather use a custom template ...
3
votes
0answers
234 views

Product image disappears on product page when using a custom page layout

I'm creating a custom theme on Magento 2.1. I create a custom layout for the product page in app/design/frontend/<theme_name>/base/Magento_Catalog/layout/catalog_product_view.xml, here it is: &...
3
votes
0answers
450 views

Pdf xml in Magento 2?

When developing a payment fee, I want to add a surcharge fee to Pdf. I found the pdf.xml config. However, I don't know how it works. Can anyone help me to explain the config pdf xml. vendor/magento/...
3
votes
0answers
1k views

Magento 1.9 add new products to homepage with Layout update XML only

I manage to show 4 'new products' on my homepage. In my Homepage > Design > Layout update XML i put the following code: <reference name="content"> <block type="catalog/...
2
votes
0answers
53 views

Move Elements on Magento 2 Product Page

I have the Porto Theme installed on my website using Magento 2.2.5. I would like to move a couple of Elements on the Product page but only for specific products. I have attached a screenshot of how ...
2
votes
0answers
17 views

Set product attribute “comment” from backend

No time for coding actually, so I just want to ask if maybe someone already has a working solution (w/o rewrites) :) I just want to add a text input field to "edit product attribute" page, that show "...
2
votes
0answers
20 views

How to deal with multiple extensions overriding the same template file?

I have two extensions which load their own template for the block with name customer_form_register in customer_account_create The first extensions overrides the template to add a new field to the ...
2
votes
0answers
63 views

Magento2: How can I add Magento_GiftMessage to checkout (billing step > afterMethods)?

I want to add the "Gift Options" (Magento_GiftMessage) to the checkout billing step. Currently it's displayed only on cart page: & I want it (also) on checkout, under the payment methods list. At ...
2
votes
0answers
59 views

Element 'argument': The type definition is abstract and The state object to be removed is not the first in the list

I'm throwing this error on my /success/ page and it seems like such a generic error. It looks like further down the trace it's pointing to stuff like GoogleTagManager and other third-party modules ...
2
votes
0answers
95 views

Upgrading from 2.2.5 to 2.2.6 several problems encrypt key exceed 32 character and layout

I'm working on upgrading my store from 2.2.5 to 2.2.6 I'm following this with my cron jobs of https://devdocs.magento.com/guides/v2.2/comp-mgr/cli/cli-upgrade.html first problem arises at php bin/...
2
votes
0answers
269 views

Magento 2 adminhtml layout.xml not loading

The Controller File works fine, die('dasdsa') works. But i am not getting any result on the Backend Page except the Title Change within the Controller. I Guess it's just something simple :X Classy/...
2
votes
0answers
49 views

Magento 2 layout XML <move /> performance

I was just wondering if anyone knows about negative performance impacts of multiple <move /> statements in a theme's layout XML files. Sometimes the <move /> statement is even in the same ...
2
votes
0answers
430 views

Magento 2 How to add Magnifier to product list page?

I have enabled Magnifier to product detail page from theme etc/view.xml <var name="magnifier"> <var name="fullscreenzoom">20</var> <!-- Zoom for fullscreen (integer)--> ...
2
votes
0answers
470 views

Magento2: How to get current URL in XML file?

I am looking for current URL in XML. Need to set canonical tag. <head> <link rel="canonical" src="I want currentUrl here" src_type="url"/> </head>
2
votes
0answers
359 views

Magento2 : Page_layout Container And Widget Configuration

I'm new on Magento 2, I have created a custom theme and a custom page_layout in /app/design/frontend/[Vendor]/[ThemeDir]/Magento_Theme/page_layout/homepage.xml <referenceContainer name="page....
2
votes
0answers
103 views

Javascript load order

I need to load some JS libraries the last of all. I used to achieve this using data-group param, like this: <?xml version="1.0"?> <layout version="0.1.0"> <default> <...
2
votes
0answers
188 views

Magento 2: How do I modify the layout of all pages using the 2columns-left layout?

According to the Magento 2.1 frontend developer documentation (http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/layouts/layout-types.html#layout-types-page) it should be possible to create a ...
2
votes
0answers
522 views

Magento 2 layout cache corruption

We have a site under Magnento 2.1.0 CE and have been experiencing a strange issue. After being hit hard by traffic (normally hacking attempts or Asian spiders that ignore robots.txt), some pages on ...
2
votes
0answers
130 views

Magento 2.1 custom theme (Login and Registration Form)

I have successfully created Magento using/ inherited from Blank default theme. When I remove the default css <remove src="css/styles-m.css" /> <remove src="css/styles-l.css" /> I see ...
2
votes
0answers
142 views

Appending product list with custom collection

I am making a small module to display a product list with content depending on the URI. /storeid/parts/ would be the base, with all parts/products /storeid/parts/mobile would contain all parts in ...
2
votes
0answers
1k views

Where to add Mailchimp Subscriber Popup code in magento

I apologize if this question has been posted before, but I checked all over google and could not find anything. I am trying to add the Mailchimp subscriber popup to my homepage, but cannot figure out ...
2
votes
0answers
2k views

Magento 2: Hook into price display on category page

I want to add custom notices directly behind every price on product detail and category pages. On product detail page this works fine with layout.xml: <referenceContainer name="product.info.price"&...
1
vote
0answers
31 views

Magento 2.2.5 configurable product is not open in admin?

I have created configurable product which has almost 2000 products associated. I want to edit some attribute but it is not opening and showing an warning: Warning: DOMDocumentFragment::appendXML()...
1
vote
0answers
24 views

Magento2: Minicart issue on Custom layout

I am using a custom layout for the category page. Here is my code: app/code/Custom/Module/view/frontend/page_layout/equipment.xml <?xml version="1.0"?> <layout xmlns:xsi="http://www....
1
vote
0answers
7 views

Magento 2 add body class into as per current page using toolbar.php plugin for category and search results page

I have created plugin for toolbar.php \Magento\Catalog\Block\Product\ProductList\Toolbar protected function _prepareLayout() { $this->pageConfig->getTitle()->set(__('Category Page')); ...
1
vote
0answers
50 views

How to move product.info.mailto block in custom layout file in magento 2?

In vendor file \magento226\vendor\magento\module-catalog\view\frontend\layout\catalog_product_view.xml I found <container name="product.info.extrahint" as="extrahint" label="Product View ...
1
vote
0answers
32 views

Magento 2 - display custom product details tab conditionally & as an URL

I want to create a custom product detail tab "Q&A" and only display the tab when there is an Q&A questions exist for the product, and the tab will be the hyperlink to the FAQ page ( for ...
1
vote
0answers
21 views

Can't get Magento 1 adminhtml layout file to load

I was working on a large module and I couldn't get an adminhtml layout XML file to load. So I created a new test module to isolate the issue and I still can't get the layout file to load. I don't ...
1
vote
0answers
26 views

how to call a grid file in form.xml in magento2

Hello everyone I want to call the grid file which is located below path Magneto\PopupQuestion\Ui\Component\Listing\Column\Products in form.xml Who to write the class for it I have written like ...
1
vote
0answers
50 views

Broken reference Error log in Layout magento 2?

Actually i am facing this error due to layout mistake.please guide me. [2019-02-18 06:28:17] main.INFO: Broken reference: the 'breadcrumbs' tries to reorder itself towards 'category.cms', but ...
1
vote
0answers
42 views

Moving Block on product page Magento 2.2.7

I fairly new to this but I am trying to move a brand logo on my product page from below the product title to below the gallery image. Normally I would be able to achieve this using my themes ...
1
vote
0answers
41 views

Magento 2 move page main title into div with product_list_toolbar

I want to move the page main title on the category list page into custom div and also include the product_list_toolbar into that div. The problem I face is that I can not simply move the ...
1
vote
0answers
32 views

Magento 2 - CMS Specific page_layout XML and Dedicated page_layouts in general?

I'm looking for some BEST PRACTICES insight into using page_layout.xml. Is it a good idea to try and decouple the non-shared resources on Product Pages, Category Pages and CMS Pages? If so, what's the ...
1
vote
0answers
20 views

How to modify part of the design of the details of the article magento 2?

I want to be able to modify a part of the page of the details of the products of magento 2 The marked part is the one that I want to be able to edit, add or remove content is that section. So far I ...
1
vote
0answers
45 views

frontend layout handle not working

frontend layout handle not working other than default.xml. Folder structure: Namespace Mymodule Block view frontend layout default.xml -- loading ...