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
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 ...
4
votes
1answer
1k views

Magento 2 - what is “at_call” for in layout file?

I often see "at_call" in the tag of a layout like below, what is this for? what it functions as? Thank you. <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.sku" ...
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
2answers
5k views

Magento 2 : Custom phtml file add in product page

How to add custom .phtml file in product details page. I also try this code in catalog_product_view.xml file, but can't working.
4
votes
2answers
4k views

Create plugin LayoutProcessor::process vs override checkout_index_index.xml

To add a custom field, I can create a plugin and it will add input on the checkout. 1) Create plugin LayoutProcessor::process Exapmle : Namespace/Module/etc/frontend/di.xml <config xmlns:xsi="...
3
votes
1answer
1k views

Only show link in Account Navigation to specific customer groups

I have a link which I've added to the Account Navigation in Magento2. It's called VIP Customer Info. I would like to be able to hide or disable this link depending on weather the customer is logged ...
3
votes
1answer
2k views

custom module layout not working

I've been fighting a while with a problem, but I can't find a solution. Here is the thing: Got a module that I need to show in the sidebar of catalog product view so this is my module.xml in default/...
3
votes
1answer
1k views

Hide or remove column from sales order grid

I want to hide or remove Purchase Point column from sales order grid in backend using custom module, how do i do this?
3
votes
3answers
3k views

default.xml in my custom module isn't working

I'm trying to add custom template from my custom module. Layout file: app/code/Foo/Bar/view/frontend/layout/default.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/...
3
votes
1answer
2k views

Magento 2: re-arrange checkout address fields

I want to change the order of the billing address inputs in checkout, so that the postcode field will be ordered before the city field. I've tried to set the orders in /view/frontend/layout/...
3
votes
1answer
2k views

Add block to each product in category view

I'm trying to add a small form to the category view to each product by using the <catalog_category_view> layout handle. The block of my module already works on product detail pages (<...
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
4answers
3k views

Add CSS class to body if the customer is logged in

I want to add a CSS class to the body when the customer is logged in or not. I thought this would work: <body> <customer_logged_in> <attribute name="class" value="customer-...
3
votes
3answers
1k views

Provide properties to views in Magento

In Zend Framework we provide properties to layouts which are then consumed in the view. An example of this would be: $this->layout = new Zend_Layout(); $this->layout->username = 'John'; $...
3
votes
3answers
10k views

Magento 2: How to call function in phtml file from parent block

I have create a block which contains a phtml file.This .phtml file called other phtml file. Please check code : block name : ..\block\country.php This block has a template file, name : country....
3
votes
1answer
211 views

Varien_Profiler and _redirect in Adminhtml

I want to profile a particular slow admin action that we have, but it calls _redirect at the end, is there an in-built way of seeing this profile information, or will I have to manually create an ...
3
votes
2answers
6k views

Magento2 loading admin layout and template in a new page

I can't get my head wrap around this. I have this controller namespace Vendor\Gift\Controller\Adminhtml\Gift; use Magento\Backend\App\Action\Context; class Index extends \Magento\Backend\App\...
3
votes
1answer
985 views

Conditionally add CSS class to body tag

In Magento 1 it was possible to conditionally add class to body tag through layout. It could be done with addBodyClass action with an additional condition in the ifconfig. For example: <reference ...
3
votes
2answers
2k views

Js file is not removed from xml

I am using the cjm colorselectorplus module. In their xml they have this line: <action method="addJs"><script helper="colorselectorplus/data/canShowjQuery" /></action> and in ...
3
votes
2answers
37k views

How to add the product filter in the sidebar?

I just want to add the default filter in my sidebar. When looking at the official Magento demo, you can see this on the left sidebar (Shopping Options.) I assume this is available out of the box to ...
3
votes
2answers
7k views

Load Custom Admin Template

Developing a simple custom module, and the hardest part is getting the template to load in the admin. I'm sure I'm missing something simple (but important). The template will not load. I believe ...
3
votes
3answers
11k views

Admin layout file not loading in custom module

I'm trying to load in a block on one of my admin pages in a custom module, but it doesn't appear to be loading. At first I thought it was a handle issue, but I've found out that the handle is ...
2
votes
2answers
3k views

How to add breadcrumbs in my account pages

I want to add Breadcrumbs in my account page & it should be displayed on every tab selection below the Navigation menu bar. But it is not showing anything on my page it is looking like this But ...
2
votes
2answers
975 views

Magento 2: Add custom code before closing head tag

I am new to Magento. I have some products in my Magento 2 website. I want to add some custom meta code before closing of head tag. Example if (page_id==1){ some code } if(page_id==2){ other ...
2
votes
0answers
65 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
3answers
770 views

Magento2 - missing adminhtml custom block after upgrade to 2.2

We had a custom block injected in the adminhtml section. This block is managed in a module (let's call it Vendor/Module) & it was working fine in Magento 2.1.*, following this methodology magento ...
2
votes
1answer
326 views

Can't override template file in Magento 2.1 module

I'm trying to override Magento's built-in addtocart.phtml file, but nothing I try seems to be working. I Have a module named QuantityDropdown under the Rethink namespace. As far as I can see it's ...
2
votes
2answers
4k views

How to pass data from PHP to JavaScript component

I've overridden the grand-total element in checkout_cart_index layout and in my custom component JS I need to get the data that I have in a PHP class with a specific logic. How can I get the data ...
2
votes
1answer
2k views

Override customer sales order history template not working

I want to override sales order history for customer in frontend like this: app/code/Test/SuccessPage/view/frontend/layout/sales_order_history.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
2
votes
2answers
505 views

Magento Custom Grid Redirect Error (On Join Attributes ONLY)

To clarify, this is ONLY on join attributes My layout handles are correctly setup, I can filter the inherited columns correctly. $collection->getSelect()->join( array('...
2
votes
2answers
760 views

Set template in XML layout file based on URL

I have the following lines in an XML layout file to set a blank template for the product_list block (we do this to hide the product listing on some anchor categories): <reference name="...
2
votes
2answers
1k views

Magento 2 - Custom Customer attribute in order create select customer grid

I am trying to add a custom column in sales create order customer grid. When admin trying to place order from back end ,after create order button click we get a customer grid . I have added a new ...
2
votes
1answer
32 views

how `$this` works in magento. and how to use it [closed]

<?xml version="1.0"?> <layout version="0.1.0"> <default> <block type="page/html" name="nav" template="nav.phtml" parent="root" /> </default> </layout&...
2
votes
2answers
5k views

Use a helper in a layout

I want to call a helper in the main layout of my website. I added this within the part of the layout : <action method="addLink" translate="label title"> <label>About us</label&...
2
votes
1answer
239 views

Combine referenceBlocks from 2 custom module into 3rd layout xml…Possible?

How to use two from 2 different modules and call them in the 3rd layout? say for eg: From CatalogSearch module, catalogsearch_result_index.xml has <body> <referenceBlock name="search....
2
votes
4answers
2k views

not able to add custom block in cart page above coupon block

i am adding the block through xml on cart page. i searching a lot but could not find the find the solution where i am getting wrong. <checkout_cart_index> <reference name="checkout.cart"...
2
votes
4answers
5k views

How to remove html head body tags in layout magento 2

Controller <?php namespace Test\QuickView\Controller\Catalog\Product; class View extends \Magento\Catalog\Controller\Product\View { } Layout quickview_catalog_product_view.xml <?xml ...
2
votes
1answer
1k views

Magento 2: How to move “Sign In” block in checkout below progress bar?

In blank theme checkout, the "Sign In" link is located at the top right of the page. I want to move it under the checkout progress bar. I tried this way but it didn't work.
2
votes
3answers
4k views

System.log error simplexml_load_string (Extra content at the end of the document)

System.log error 2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document in /var/www/html/magento/app/code/core/...
2
votes
1answer
320 views

Error in “Remove a component” plugin tutorial

I am trying to follow this tutorials "Remove a component" But getting next Error: "Uncaught Error: Cannot use object of type Magento\Checkout\Block\Checkout\LayoutProcessor\Interceptor as array in". ...
2
votes
2answers
336 views

How Can A Block Render Without Specifying `as` property of the block, When we use getChildHtml() Method

This is the source for my doubt. Please have a a look on this question, answer and answer's comment. Basically the question demands to include a core/template block inside header block. For this we ...
2
votes
2answers
2k views

toHtml function is empty issue

This is my code: $invoice = Mage::getModel('sales/order_invoice')->load($invoice_id) $block = $this->getLayout() ->createBlock('mynamespace_mymodule/pdf_invoice') ->...
2
votes
2answers
2k views

Move Newsletter Subscription form before footer Magento 2

I'm using magento 2, and I'm building a theme with the blank theme parent. What I'm trying to do is to move the subscription form, from the footer, before the footer, so it's not into the footer ...
2
votes
2answers
2k views

Override Page module in magento

I have override page Module means changes the footer pages. So that I have created Page module. but it's displaying empty page. my code is: magento\app\etc\modules\Page.xml <?xml version="1.0"?&...
2
votes
2answers
14k views

Magento 1.9: Remove Category Filter in Layered Nav

After a few minutes of search, I found the solution that I'm looking for, and it's here: How can I disable filter "category" from Sidebar I followed this method by editing the catalog.xml ...
1
vote
1answer
723 views

Hide address fileds in registration page

I have created a cms page for registration page, which is working fine. My layout Update XML is below <reference name="content"> <block type="customer/form_register" name="...
1
vote
1answer
1k views

What layout xml is used for email templates?

If I create a email template in System > Transactions Email what xml layout is used? What is the block type here?
1
vote
1answer
87 views

remove header part from some .phtml pages [closed]

visit these links : http://4.videomergerapp.com/ we removed the complete header part [except logo ] in the following page : http://4.videomergerapp.com/marketplace/ I want to hide complete header ...
1
vote
3answers
3k views

Magento disable cache for price block

In my project we are using Magento Enterprise Edition 1.14.1. The prices in store are changed dynamically direct from Database. So the problem is Magento cache every thing (full page cache) so the ...
1
vote
1answer
2k views

Check if block rendered and displayed on the current page

Is there any way I can check if a block is displayed on the current page? I have a block my.banner with simple image. This block is added to the left sidebar on many different types of pages, e.g. on ...