Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [layout]

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

564 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10
votes
1answer
894 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
759 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
1answer
70 views

Set custom tab in customer edit page Active

I created a custom tab for customer edit page in backend like this: app/code/Namespace/Module/view/adminhtml/layout/customer_index_edit.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
5
votes
2answers
302 views

Magento 2 : How to debug knockoutjs getRegion() bindings

Shipping address is displayed using below knockout js code. I am having a hard time finding the back-end code that's setting data for getRegion('ship-to') function even though I could see the UI JS ...
5
votes
0answers
372 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 ...
5
votes
0answers
113 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
460 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
1k 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
1answer
696 views

Magento 2 - assign custom email template to specific payment method

What is the proper way to assign custom email template to specific payment method upon creating an order? For example: When choosing a Bank transfer payment method on the checkout it should send ...
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. ...
5
votes
1answer
643 views

Custom page layout not working

Im going crazy here. Can't get this to work. I'd like to make a custom page layout like the 1column, 2columns-left etc. I've searched and read multiple tutorials all doing the same. Nothing works ...
4
votes
1answer
782 views

Magento 2 Blank Layout Page

I tried to create a new tab in customer edit backend. First i create the app/code/Namespace/Point/view/adminhtml/layout/customer_index_edit.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
4
votes
1answer
416 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 ...
4
votes
4answers
1k views

How to call module block after header?

I have a module layout file like below <default> <block name="ampromo_notification" type="ampromo/notification" template="amasty/ampromo/notification.phtml" before="-" /> <...
4
votes
1answer
179 views

Magento 2: How to create custom layout instructions to match a custom product page layout?

I am trying to work on a product subscriptions page which is very different in function from a standard product page. I have created my new Magento_Theme/page_layout/subscription.xml I set Magento 2 ...
4
votes
1answer
681 views

How to locate culprit for “Please correct the XML data and try again” error

Getting the following error on the cart page of Magento 2, checkout_cart_index. It's a code base with no version control and this issue is present even when I'm using the default Luma theme. I've run ...
4
votes
1answer
881 views

XML - Cannot move product.info.review after product.info.overview

I'm trying to do the following, moving product.info.review after product.info.overview (short description) I've used the following code, but it is not working: <move element="product.info.review"...
4
votes
1answer
2k views

magento2 -custom layout file not loading

i have followed the below link in order to get check if our custom layout xml file is loaded or not using the event: layout_generate_blocks_after In the log file i just get: 2016-06-29T11:07:40+00:...
4
votes
2answers
1k views

Not displaying breadcrumbs in Contacts page

In my site, the breadcrumbs are not displaying on the Contacts page. I have added the code for breadcrumbs in contacts.xml (given below), but still not working. <layout version="0.1.0"> <...
3
votes
0answers
37 views

Call a Shipping field from front end to backend Magento 2 Layout processor

I have added a custom delivery date option in shipping method on front end using layout processor and it is showing and working fine. Is there any way to merge or call the same method in backend order ...
3
votes
0answers
26 views

Production mode doesnt load any content for custom module

I have created a custom module in Magento 2. In developer mode it is working well, however same module does not show any content in the production mode of Magento its show only white screen. There is ...
3
votes
0answers
25 views

How to organize layouts?

I'm on the product page and in my layout i created a block to render on the product informations, on the upsell product informations and on the related product informations but it doesn't works. The ...
3
votes
1answer
52 views

Custom Theme XML Files Changes 2.2 to 2.3

Does anybody know if there have been changes to the way XML files from custom themes are included in Version 2.3? I have a very simple XML file to modify the Magento Advanced Search page. The custom ...
3
votes
1answer
382 views

Defer JS / CSS Magento 2 via layout files?

After reading a lot of devdocs, I can see there is a case for deferring in CSS and JS in the manual https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-types.html#layout-types-...
3
votes
0answers
176 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 ...
3
votes
0answers
51 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
1answer
702 views

$block->getViewModel() returning NULL

I am overriding the layout and adding ViewModel in that layout but when I try to fetch the ViewModel getting below error PHP Fatal error: Uncaught Error: Call to a member function getCodes() on ...
3
votes
1answer
3k views

Magento 2.2.2 - Display Customer Account header dropdown and remove Sign Out link post login

After successful login, Luma theme shows customer account details in dropdown on header as seen in below image I need to replicate the same in our custom theme which has Blank as its parent. Vendor/...
3
votes
1answer
693 views

Magento 2 Init script after page load

Is there any option to init (text/x-magento-init) script after page load? Example, I am working on a simple quickview feature and my controller returns my a layout - phtml file - with rendered html ...
3
votes
0answers
157 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
32 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
1answer
74 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
2answers
2k views

Magento 2: How to call Widget programatically?

I have created widget Type: CMS Static Block Theme: My Theme Display on: All Pages Container: CMS Footer Links Template: CMS Static Block Default Template Widget Options: Block (My selected block) ...
3
votes
2answers
1k views

How to override layout file, which is already override by other theme - layout\override\base\somel_ayout.xml

How to override layout file, which is already override by other theme. For example, we have existing theme. app\design\frontend\<Vendor>\<themeone>\Module_Vendor\layout\override\base\...
3
votes
0answers
599 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
1answer
280 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
3answers
2k views

Magento 2: How to find layout position name for destination attribute of a move tag

In magento2 to change a position of block <move> is used whose syntax is as follows. <move element="name.of.an.element" destination="name.of.destination.element" as="new_alias" after="name....
3
votes
1answer
545 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
2answers
1k views

Magento Container not working in custom layout

I have created a custom XML layout page that I will be using for my home page. Right now it is a clone of the normal 1column.xml layout, and I'm trying to add a container for an image slider. Here is ...
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
73 views

Missing column in Shopping Cart Table in magento 2

Here is my snapshot: The row of "Angel Light Running Short" does not having column stock. And then I tried to empty my app/code/Company/ModuleName/view/frontend/templates/cart/item/default.phtml ...
2
votes
1answer
164 views

Override Magento 2 checkout.cart.methods.onepage.bottom proceed to checkout button Block and template file

I see below configuration in Magento 2 layout at vendor\magento\module-checkout\view\frontend\layout\checkout_cart_index.xml. I created custom module and copied existing Link Block and link.phtml to ...
2
votes
5answers
315 views

Remove cms block from only cms home page

I have created a cms block and using widget added inside header page container, now I want to remove that block from only home page. How can i achieve this? Widget screenshot to display block
2
votes
1answer
32 views

Magento custom theme, overwrite block content

I developed a custom theme for Magento 1 for one of my projects. Or tried to follow the guidelines of the communites. I have not overwritten the files {layout}.xml I have created new ones on a module ...
2
votes
0answers
18 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
26 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
189 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
107 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 ...