Questions tagged [layout]

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

620 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
11
votes
1answer
1k 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 ...
9
votes
1answer
917 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 ...
6
votes
0answers
452 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
3answers
2k 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 ...
5
votes
0answers
133 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
538 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
887 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
2k 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
963 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
0answers
94 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 ...
4
votes
0answers
603 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 ...
4
votes
0answers
81 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 ...
4
votes
1answer
1k 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
4k 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/...
4
votes
1answer
737 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
2k 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
247 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
686 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
1k 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
1answer
716 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/...
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
128 views

Admin side when Create Credit memo give error like No such entity with cartId = xxx in magento 2

when I am creating a new credit memo error generate like No such entity with cartId = xxx .so why this error generate anyone has a solution then give me. also, remove generated and var/*. Thank You
3
votes
0answers
63 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
77 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
1k 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
1answer
999 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
608 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>
3
votes
0answers
159 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
38 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
81 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
228 views

Whats the main use of item name=“types” in magento 2 checkout xml file?

In checkout_index_index.xml file, What's the use of item name="types" in checkout page? Also item name with form.input is not defined anywhere in checkout module. <argument name="jsLayout" xsi:...
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
1answer
821 views

Block not showing after layout update

Considering this layout update XML: <?xml version="1.0"?> <layout version="0.0.1"> <checkout_cart_index> <reference name="methods"> <block type="...
3
votes
0answers
603 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
503 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
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"&...
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/...
3
votes
1answer
522 views

How can i remove update handle in magento 2

I have removed blocks from xml file using <referenceBlock name="page.top" remove="true" /> but how can i remove <update handle="customer_account"/> from the layout file.
2
votes
0answers
34 views

Magento 2.3.4 new layout update doesnt work

I have an issue with the new Magento layout update xml feature. I added a custom layout update file to change a category. It shows up in the Magento backend, but when I select it, nothing changes on ...
2
votes
0answers
14 views

Magento 2 - uiComponent doesnt paginate properly neither export

I am trying to make a grid on the admin panel with a custom collection (custom dataSource). The problem I am facing is that it doesnt paginate properly (all records are in one page but the pagination ...
2
votes
0answers
30 views

How can I show related products in magento 1.9

I am using Magento 1.9 with porto theme. i want to show related product in product page . I searched a lot on google , stack platform & in magento community. i tried all possible ways to add ...
2
votes
0answers
74 views

Use knockoutjs in Ui component of Admin form

I have created a form using UI component on Admin side. If i want to add a .phtml then i can add the file this way. <htmlContent name="driven_form_design"> <block class="Magento\Backend\...
2
votes
0answers
116 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 ...

1
2 3 4 5
13