We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [layout]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
34 views

Overriding template not working in dev branch

I have overridden a file vendor/magento/module-customer-custom-attributes/view/frontend/templates/customer/address/edit.phtml and placed the replaced file in: app/design/frontend/ParentTheme/...
0
votes
1answer
21 views

Wrong Layouts in Magento2 Adminhtml

I noticed a strange behavior in a M2 System, I think this is related to a 3rd party module. All layouts which should be 1column layouts are 2 column layouts actually so something overwrites the ...
3
votes
1answer
30 views

SOLVED Createblock definition in magento 2

i search around a lot about references of this function. but the documentation have a big lack. does somebody explain me this part of code (deeply) ? $this->getLayout()->createBlock(...
1
vote
2answers
65 views

How to remove base url from layout argument

I am using layout argument in path but it display with base url like <block class="Magento\Framework\View\Element\Html\Link" name="search-mini-text"> <arguments> ...
0
votes
0answers
16 views

Change mobile navigation

I am trying to work out which xml file controls the menu on luma for mobile so that I can remove the Menu/Account section here at the top So I can achieve something similar to this
0
votes
0answers
33 views

Contact form in CMS page with form.additional.info

I'm trying to add the contact form to my CMS page. I can add {{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}} as indicated on this post ...
1
vote
1answer
39 views

Difference templates and layouts

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/debug-theme.html I am following the magento docs to create a theme for practicing, it shows me how to find these things but I would ...
0
votes
0answers
59 views

2 columns-left category product list page layout, how to change left side bar width?

The left side bar width for the category product listing page is now became smaller, i'm not sure how it has been changed. I believe not in "catalog_product_view.xml", and i can't find another other ...
0
votes
1answer
95 views

recently viewed product collection is empty in magento 2

I have added a code in Magento_Catalog/layout/catalog_product_view.xml <referenceBlock name="product.info.details"> <block class="Magento\Reports\Block\Product\Widget\Viewed" name="...
1
vote
2answers
104 views

Magento 2 how to remove “SKU field” via Layout Update XML?

I'm stuck on this: I need to remove the SKU field from product page only for few products, I'm sure that I can do it with "layout update XML" tab but all my attempts have failed.. any help? :)
2
votes
2answers
36 views

Magento 2: How to add a div in below navigation?

I am trying to get a div displayed directly below the navigation on a theme which extends Luma I have added the following into my Magento_Theme/layout/default.xml but cannot see any results. The ...
0
votes
1answer
61 views

How can i add block to existing layout in catalog_category_view.xml?

I want change layout of catalaog_category_view.xml but i can't. I override block category.products and it's work but how can i add my own block to existing category.products block? Because i want add ...
1
vote
1answer
36 views

How I can add custom block to layout using php in Magento 2

I have created a custom block, as I want to add this layout to my current layout. Following is my block: <referenceContainer name="sidebar.main"> <block class="Vendor\ModuleName\...
0
votes
1answer
116 views

Magento 2 : Exclude CSS from merged file just for the homepage

I have merge and minify CSS enabled and I would like to know if is there a way to exclude a specific CSS file from the final merged file, but only for the homepage? I know how to remove a CSS file ...
0
votes
1answer
22 views

CMS statsic blocks doesn't show for Ar store language - Magento 2?

i have a multi language Magento2 Store and i have CMS static blocks in home page , so to translate these blocks i had to duplicate each block and change store view to En or Ar for each block to show ...
3
votes
1answer
37 views

Magento 2 view product give different result for different category

For learning purpose I just added following css in my Module: .newcolor { background: #ffff00 !important; box-shadow: 1px 5px 5px 1px rgba(66, 103, 178, 0.51); font-size: 23px !important; ...
2
votes
0answers
71 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 ...
0
votes
1answer
30 views

Retain the logo but remove all other elements of header and footer

The Magento Ver is 1.9 and the theme is a variant of the rwd theme. For a home page design I need to remove the header and footer completely but retain only the logo. I have tried this with the ...
0
votes
1answer
66 views

How to render a block/template after page load

I need to know whether we can render a block or a phtml template file after the page load. I have added the block and template file in the layout file and it works fine. But i dont want that data to ...
0
votes
1answer
10 views

Customization mistakes and changing the layout type of a core page configuration xml

In the official M2 docs we have this quote Changing handle inheritance. For example, you should not change the page type parent handle. Pulled from here M2 Frontend Dev Docs By this I understand ...
0
votes
1answer
25 views

Add content of static block as new tab to product detail page

I created 3 static blocks with just a random headline for now, where I want to add html content later. the ids of the blocks are: warranty instructions certificates I then created 3 .phtml files ...
0
votes
3answers
83 views

Layout - Pass variables from parent to child

How can I access variables defined in the parent template inside a child template? Example -> I added a new block with name product.info.grouped.news_flag as child of the block with name product.info....
1
vote
1answer
29 views

Add an Element on the top of header.panel.wrapper

I need to place an element ot the most top of page. the position is exactly on the top of header.panel.wrapper. My objection is to have some elements on the the most top of header. Any help ...
1
vote
2answers
85 views

Move recently viewed product or completely remove it

Magento has a great feature to show recently viewed product, but now I need to move this element (recently viewed product) to exactly on the top of footer. I have no clue about how to show/hide or ...
1
vote
1answer
38 views

Unknown UL LI tag broke the layout

I got this annoying issue: that's unwanted spaces thats caused by unknown HTML: My question is how to remove that unwanted annoying html (UL/LI) from home page? Thanks
1
vote
1answer
38 views

Home to make a Multi Level Field Dependency in Admin Form Magento 2

I have 3 Field type Display On Container the visibility of [Display on , container] depends on value of type field value of [container] depends on value of [Display on ] on field I have tried this ...
1
vote
2answers
34 views

Magento 2.3 How to override the custom theme's etc/layouts.xml file in recommended way?

There is, in a theme that I bought a layout.xml file that is used in the backoffice to hydrat a select element (that allows you to switch between 5 layouts). app/code/CompanyTheme/LayoutSwitcher/etc/...
2
votes
1answer
27 views

Removing block from layout doesn't work

I want to remove the register-link from the header links, so I have wrote in the default.xml of the Module_Customer of my theme: <referenceBlock element="register-link" remove="true"/> The ...
0
votes
1answer
73 views

Apply a jQuery whitespace trim to an adminhtml filter input

My goal is to load a simple jQuery function to trim any whitespace in an admin backend filter input. The use case involves a scanner inputting codes with spaces that will turn up no results. I have ...
0
votes
1answer
292 views

Magento 2: Header and footer not loading in custom module's CMS layout

I am developing a custom theme which inherits from Magento/blank. I am attempting to develop a CMS homepage layout within a custom module. I have created the module and successfully applied the ...
0
votes
0answers
10 views

Custom template not applying the proper layout and appearing under menu

We have created a custom template to show some documents and download them. This template is located in the backend. You can access through the menu and the submenu of one of the options. "Dealer ...
0
votes
0answers
23 views

referenceBlock and referenceContainer [duplicate]

what is layout reference and block in magento2.referenceBlock and referenceContainer.
0
votes
1answer
250 views

Move static block on category page

I'm trying to have 2 pieces of static content on a category page. One directly beneath the category title and another below the product listings. I notice Categories have a "description" and support a ...
3
votes
2answers
49 views

How to move Magento 2 Search bar to be centered

Here is my current search bar: And here is my expectation: I still don't understand about how to make centered search bar like that ? here is my html (from inspect element): <header class="page-...
2
votes
2answers
254 views

How to Get Layout Name in which is block is placed

I have My block <block class="Vendor\ModuleName\Block\Frontend\Linked" name="catalog.product.linked" template="Vendor_ModuleName::slide.phtml" /> in this file app\code\Vendor\ModuleName\...
1
vote
1answer
21 views

Add custom block under long description (product.info.description)

I'd like to add a custom block in description tab just after long description field. I Tried <referenceBlock name="product.info.description"> <block class="Magento\Catalog\Block\Product\...
0
votes
0answers
20 views

Magento 1 layout best practice

So on a multistore Magento 1 we need to change the html on a page depending on the store, everything is done with one theme. And we have 2 implementations, but I'm not sure which one is better. ...
3
votes
1answer
51 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 ...
1
vote
1answer
33 views

Remove class on div from empty.xml layout

I am running Magento 2.2. I have custom HTML I want to add to a CMS page. After navigating to the page where this HTML resides, the content is automatically displayed inside a div with class page-...
0
votes
1answer
21 views

Order of execution of the <referenceBlock name=“before.body.end”>

I want to add a js script near the </body> tag. But, in my project there are more than one layout files having <referenceBlock name="before.body.end">. So, is there a specific order in ...
2
votes
3answers
30 views

Move block and set template

I succesfully moved the product related block in my page layout with <move element="catalog.product.related" destination="product.info.right" after='-'/> I want now to apply a custom template ...
1
vote
0answers
53 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()...
0
votes
1answer
30 views

Some product pages layout issue Magento 2

Suddenly my site has suffering layout issue on some product pages. I checked in console and it says require is not a defined, but many other product pages and site is working fine.
0
votes
2answers
44 views

Remove add to cart on category product

I am trying to remove the add to cart and add to compare buttons from the category page. At present I have used the following code: <referenceBlock name="product.info.addtocart" remove="true" />...
0
votes
1answer
245 views

How to remove an argument's item in LayoutXML

How can I remove an argument's item in Magento's LyoutXML? For instance I would like to remove <item name="msrp_price" xsi:type="array"> from catalog_product_prices.xml. In my theme's ...
0
votes
0answers
38 views

How to move checkout-agreements before buy now button in billing step in checkout?

How to move checkout-agreements before buy now button in billing step in checkout? Magento version is 2.2
1
vote
1answer
22 views

Changing block location based on size?

I want to have a block (contains a image and some text, nothing overly fancy) appear on the top of the products in a category page when it is on desktop, then on mobile I want it to be on the bottom ...
3
votes
1answer
369 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-...
0
votes
1answer
31 views

Add additional tab after reviews

I am trying to have a few more additional tabs added after the Reviews tab, though my tab keeps appearing as the first tab <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/...
1
vote
2answers
165 views

Move category description from admin panel (Layout Update XML) in Magento 2

Our customer wanted to show category description after the product list by default, so we added a new container and the following line to the default.xml in out theme: <move element="category....