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
6
votes
2answers
3k views

Magento 2.2.1 - how to give discount on payment methods?

I go to Magento 2.2.1 Admin > Marketing > Promotions > Cart Price Rules and create a new Rule: Conditions. Option "Payment Method" is not showing up in Conditions Tab. I want to give some ...
5
votes
1answer
11k views

How to add custom block at the /checkout/cart/ page?

I am working on a custom extension and i want to add additional block to the /checkout/cart/ page. Take a look: Here is my config: <?xml version="1.0"?> <config> <modules> &...
5
votes
2answers
7k views

What is <update handle=“customer_account”/>?

What is the Handler? Can someone explain the below code? <update handle="customer_account"/> or same code like above for example : <update handle="default"/> and how it worked !?
5
votes
2answers
2k views

Add custom block to admin order view

I am trying to add a custom block to the admin order view page and am doing this via an observer using the event core_block_abstract_to_html_before. I am using the giftmessage block, clone it and add ...
5
votes
1answer
2k views

How can I add meta noindex to all catalog search result pages in Magento2?

As the title states: How can I add meta noindex to all catalog search result pages in Magento2? I am hoping for an XML Layout solution.
5
votes
5answers
4k views

How to remove “Help us keep magento healthy” in Magento 2.1

Can anybody tell me where they moved this? Changed the footer.phtml in /html/vendor/magento/module-theme/view/frontend/templates/html But it is still being shown, so it must be somewhere else.
4
votes
2answers
5k views

Current page layout handle Magento2

In Magento 1 I could get the current page layout handle like this $handle = Mage::app()->getFrontController()->getAction()->getFullActionName(); This would return for example for a product ...
4
votes
1answer
10k views

Magento 2 - how to make a custom (home) page-layout [duplicate]

The overrides structure that I have made for custom theme is (based on Blank): app > design > frontend > Magento > gc>Magento_Theme > templates It's now possible to override phtml ...
4
votes
2answers
11k views

How to override product list page [duplicate]

I'm trying to override the list product page. My objective is add certain information on each product above the add to cart button for example. I already did with the single page product, just ...
4
votes
1answer
2k views

NO INDEX, NO FOLLOW on Specific Category Magento 2

Can I set a specific category to NO INDEX, NO FOLLOW in Magento 2? In the previous version I could use an updated layout XML reference to do this within a specific category.
4
votes
1answer
2k views

Can I get store configuration value in layout.xml file?

I have created a module in which I have some setting in admin panel for layout. My layout.xml code (in this I have added link in top links): <reference name="top.links"> <...
4
votes
2answers
683 views

Where does Magento look for a controller when the layout filename is bigger than three names?

I understand that in my module/view/frontend/layout folder, if I create a file called social_index_index.xml this file will refer to a controller located at Social/Controller/Index/Index.php. However ...
3
votes
2answers
2k views

How to move Success, Error messages position?

How to move Add to cart success and error message above Add to cart button and not at the top ?
3
votes
3answers
9k views

How to remove tool bar in Magento 2

I would like to remove the tool bar from my theme since I don't have that many products. So far I have tried this in my /app/design/frontend/VENDORNAME/THEME/Magento_Theme/layout/default.xml <...
3
votes
1answer
7k views

Magento 2 How to get category tree (collection) on footer

I need to display magento 2 category tree on footer and on some other places. I think best practice is creating a module and call it on desired block (place). How to do that ? I already created a ...
3
votes
2answers
3k views

Completely overwrite parent theme layout from the default.xml file of the child theme

I am working on a Magento 2.1.7 shop. To achieve this, I have created a child-theme of Magento Blank. I am new to Magento unfamiliarized with the complexity of overwriting the parent theme's layout ...
3
votes
1answer
2k views

Magento load layout handle directive programmatically

In an e-mail template I found this layout handle which is displaying an overview of purchased products: {{layout handle="sales_email_order_items" order=$order}} I'm trying to load this layout handle ...
2
votes
3answers
2k views

How add div after image block in Magento 2?

I want to add custom div after image block of product view page. In that div I will add custom html like add any text, image etc. Anyone have idea how we add custom div by plugin or observer?
2
votes
1answer
3k views

how to disable cache for a CMS page?

I want to disable the cache for a particular CMS page I have hours and hours search through the internet and gained nothing. I know that an observer load pages and so i can ban cache for the ...
2
votes
2answers
110 views

Is there any events that are `specific layout handle based` or `specific controller based`?

So I have a situation where I really need to observe an event which is layout handle specific. In my case, I want to set a root template for the handle catalog_category_default. I think I can use ...
2
votes
2answers
937 views

How to target a specific Admin Config section with a layout update

It is relatively easy to target the adminhtml_system_config_edit node with layout updates in a layout.xml file by using: <adminhtml_system_config_edit> <reference name="head"> ...
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 ...
2
votes
1answer
3k views

How to override the blank theme by default.xml?

I tried to override the app/design/frontend/Vendor/MyTheme/Magento_Theme/layout/default.xml, but it doesn't show any changes. I want to add custom links in top.links of parent theme (blank theme): &...
2
votes
2answers
879 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\...
2
votes
3answers
6k views

How to check whether a block exist ( based on its type )

This really confuses me !! I came to a situation, where I need to create a new block (core/template block) programmatically, if there is CMS Block present in a page layout. In general case, according ...
2
votes
2answers
2k views

How to override adminhtml phtml in Magento2?

How to override vendor/magento/module-shipping/view/adminhtml/templates/view/form.phtml file in magento2
2
votes
3answers
13k views

Changing the Search Results page to use 1 column layout in Magento2

As far as I can tell Magento2 is not working as expected here. In /Magento_CatalogSearch/layout/ I have 4 XML files: catalogsearch_advanced_index.xml catalogsearch_advanced_results.xml ...
2
votes
2answers
12k views

How to move category title above products column in Magento 2

In Blank theme the category name is located to the left just above the layered navigation sidebar. I'd like to move the category name to the right, above the products column, so the side bar goes up.
2
votes
3answers
5k views

Magento 2: change the “Contact Us” page layout

I am working on a Magento 2.1.7 shop and I have created a child-theme of Magento Blank. I've changed the layout of my homepage to 2 columns with left bar from Content -> Pages. I need to do the ...
1
vote
2answers
4k views

Add a child block to product.info.tabs description tab

I am using tabs for my product view page. In my local.xml I have the following: <catalog_product_view> <reference name="product.info"> <block type="catalog/...
1
vote
3answers
12k views

Magento custom block shows Fatal error: Call to a member function setTemplate() on a non-object

I have created one block inside my custom module but it's not working. My module is working fine but my block is not working when I call my block from footer.phtml file it shows 'Fatal error: Call to ...
1
vote
2answers
318 views

where is default template for link defined?

Please look at this screenshot: Then look at "Mi cuenta" and "Crear una cuenta" links. As you see, those don't have templates defined, and in fact, when I saw the XML for layout, there is no en ...
1
vote
2answers
4k views

Magento 2: magento layout not pick by magento

I found this error in system.log file and my layout is not loading in frontend. main.CRITICAL: Broken reference: No element found with ID 'before.body.end'. [] []
1
vote
1answer
11k views

change the layout of the home page

I am trying to change the layout of home page to 2columns-left.phtml. According to my understanding if I change the template file of the "root" block, in page.xml layout file, to the above template ...
1
vote
2answers
6k views

Magento Local XML not called

I was wondering why my Magento local.xml is not being called. I have a package with multiple themes. Package Default /layout/local.xml Theme1 /layout/local.xml Theme2 /layout/local.xml I'm ...
1
vote
1answer
2k views

Form Creation for Custom tab in customer dashboard Magento 2

I added custom tab in customer dashboard, using customer_account.xml and i need to create form to this custom tab, if I click this custom tab, form will open in content area based on customer ...
0
votes
3answers
9k views

How to move the add to cart section under the short description on product view page

I am customizing the Magento2 Blank theme, by using a custom child theme. On the product page, I want the custom options and add to cart section to appear below the short description. All products ...
0
votes
1answer
9k views

How to Add Admin page new menu and a sub menu under existing menu

I tried to create a simple module and menu.The Menu is successfully created and show. My question is how to add the same menu as a sub menu of existing menus(Ex : System). here is my Approach to ...
0
votes
3answers
2k views

Difference between <catalog_category_default> and <catalog_category_view>

in vendor.xml file Difference between <catalog_category_default > <reference name="content"> <block type="vendor/vendor" name="vendor" template="vendor/...
16
votes
5answers
12k views

Magento 2: How to set custom template for core block

I'm trying to override the register.phtml in my module, but it seems there are some config problem that make Magento unable to use my custom template to override the one in core module. I've checked ...
13
votes
5answers
558 views

How to make a module layout to be shown on all themes

Here is the situation: I have several self made modules, all tested and working using the default theme. Then we bought and installed a new theme. Switched to the new theme and the modules are not ...
7
votes
2answers
10k views

magento 2 how to add phtml file after after_body_start

In magento1 we use this reference to add block after body tag. <reference name="after_body_start"> </reference> same also use in magento 1 <reference name="before_body_end"></...
7
votes
3answers
22k views

How to change layout of product detail page?

I've set up a child theme of Luma and want to change the layout of my individual product detail page. What file controls this? I don't see the .phtml file and don't see how changing block order in my ...
6
votes
3answers
2k views

Use of ifconfig tag in layout xml?

What is the use of ifconfig tag inside the block tag in a layout xml file? What purpose does it serve?
6
votes
2answers
15k views

Removing Welcome message from magento 2 - just xml

I've started to work on Magento 2 and get my head around it, I'm really familiar with Magento 1 and removing the welcome message was no big deal. However all I've found the location of the welcome ...
5
votes
1answer
7k views

Remove js file for specific type of product view

I need to remove/disable a js file which is loaded in page.xml, within the block <block type="page/html_head" name="head" as="head">, but just for "Grouped" products. The file name is jquery-ui-...
4
votes
2answers
1k views

Magento2: How to set product wise different layout

I have Two product. Both are Downloadable. I want different layout for both product. Except below concept: catalog_product_view_id_1.xml The second concept I am using is with help of observer, But ...
4
votes
1answer
2k views

Change layout for specific category (productpage)

I got a specific category and I want to change the layout for all the products the category contain. If I want to change the layout(productpage) for all categories I need to edit the file app\design\...
4
votes
1answer
330 views

In what order are theme files processed?

Please note this question is about the yet-to-be-released Magento 2, which I'm still trying to get to grips with. Each module contributes to each layout handle separately. For example, the default ...
4
votes
2answers
21k views

How to change template of category page depending on category level in code?

I had a project where there was no pattern and I applied all changes of categories layout in Admin area (Catalog->Manage Categories->Custom Design tab). Now I need to have the following: Parent ...