Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

1
vote
1answer
15 views

Custom link in Account dashboard Magento 2 with order history

I am trying to add custom link in account dashboard of customer account navigation. Used below code to add link on left side in my layout/default.xml <body> <referenceBlock name="...
1
vote
1answer
26 views

Magento2 : How to create frontend layout files for controller's different action wise?

I have two controller action [1] /app/code/Mycustom/Custompage/Controller/Mypage/View.php and [2] /app/code/Mycustom/Custompage/Controller/Mypage/View/Mytest.php . I have cretead frontend layout ...
0
votes
2answers
25 views

How to disable cache for specific file?

I want to disable cache for a specific file which I am loading with a layout file. Is this possible? I tried it like this, because I saw it like this somewhere: <reference name="head"> <...
0
votes
0answers
17 views

Copy block in XML file

I need to copy the block cart.summary in checkout_cart_index.xml. How can I do this ? I've copied the block and change the same but it not working. (I only have my original block)
0
votes
0answers
15 views

Add a block (PHP) to pass data in custom home page

I need to pass data from a block PHP into my new custom home page. But I have created the page_layout/custom_home.xml into Magento_Theme inside app/design/My/Theme folder. Where should I create a ...
0
votes
0answers
6 views

Magento 2 - Move Blocks based on Design Layout Type of Product

I want to have a few layout types for products and control this via either the category and apply to child products or via individual products. I want for example to change to a 2 column view ...
0
votes
2answers
27 views

Magento 2 moving top.search block before minicart

I seem to being having an issue with moving referenceblocks. I have created a child theme based off of Blank. In my default.xml file, I moved both minicart and top.search blocks into header.panel ...
1
vote
0answers
7 views

different catalog_product_view per category

So I have a webshop that needs different ways of showing product detail pages. For example: product A is a configurable product that needs to show a contact form. But product B is also a ...
0
votes
0answers
16 views

Magento 2.2.6 Grid layout doesn't work after new installation

I just installed M2(2.2.6) and everything works fine but only grids layouts doesn't seem to work. I don't see any console errors. can anyone have any insight on this. Thanks Please find below image:
0
votes
1answer
27 views

Wrong template location after overwrite

I have overwritten the _beforeToHtml() method in the class Magento\CatalogWidget\Block\Product\ProductsList. After doing this, I received the following error: Invalid template file: 'product/widget/...
0
votes
1answer
27 views

Update page layout sidebar-main and column.main widths

I'm on Magento 2.2.4 and I can't figure out how to edit the CSS for the catalog view page. I'm trying to edit .page-layout-2columns-left .column.main and .page-layout-2columns-left .sidebar-...
1
vote
2answers
54 views

Magento 1 - action method setTemplate is ignored

I try to overwrite a template file with another one which I provide with my extension. I also noticed that other action methods are working just fine, e.g. <action method='addLink'... successfully ...
0
votes
2answers
34 views

Remove My Account top bar when user is not logged in

i want to remove magento top link My Account if user is not logged in ,i do not want to modify core files, i tried to get solution but could not find any working one . i tried below method in : "...
0
votes
2answers
49 views

Magento 2 - Disable some modules per store view

I have setup two stores in Magento 2.2.6, each store have their own theme and url address. In one store I have Porto theme installed in the second store I have other theme. How I can disable for ...
0
votes
0answers
21 views

Product page layout is not working for simple product in Magento 2?

I am using Magento 2.2.3 I have created customtheme in this theme I have created below layout file for product detail page: app/design/frontend/My_vendor/my_theme/Magento_Catalog/layout/...
0
votes
1answer
21 views

How to add lists brand under footer

I want to add brands list under footer: Can anyone help?
0
votes
0answers
20 views

New Installation. Grid layout broken on few tabs

Does anyone have same issue? few grids work fine. Not sure what's the issue. Any help please. :)
0
votes
0answers
15 views

Adding if condition in layout xml file

I want to add a if else condition statement in a layout xml file. I have to two uicomponent file. if condition 1 then uicomponent file 1 else uicomponet file 2 Any help.
0
votes
0answers
17 views

Magento 2: Warning: simplexml_load_string(): Entity: line 1: parser error : XML declaration allowed only at the start of the document

I am using magento 2.0 I have learn magento2 tutorials(No frills magento2 layout) of alan storm. I have create two xml files. when i run controller file then give Following error Warning: ...
0
votes
1answer
22 views

Magento 2.2: How can I override “checkout.item.price.unit” and “checkout.item.price.row” in the cart?

My goal is to switch out the .phtml files: magento_module-wee::item/price/unit.phtml as well as magento_module-wee::item/price/row.phtml with my own custom ones and change how the prices are displayed ...
0
votes
2answers
24 views

Magento 2 - Categories not display when Page Cache is on

I have a very strange issue on Magento 2.2.2, if I enable the Page Cache (Full page caching - FPC) the top navigation is not display anymore. What I can do? Thank you
1
vote
1answer
50 views

Magento 2: Add child div containing all items in columns

Below is my html struture of 2-column layout, <div class="columns"> <div class="column main"> ------ </div> <div class="sidebar sidebar-main"> -----...
0
votes
0answers
12 views

Widget instance in new structural block

I have made a new structural block in page.xml like this: <block type="core/text_list" name="newreference" as="newreference"/> Now it appears in the Layout Updates when I create a new widget ...
1
vote
0answers
31 views

Magento 2: Configure just only for one country

We have a magento 2 store, with more than 20 stores location and they are being separately maintained in the same web site, we do sell only in the country. is there anyway that I could completely get ...
0
votes
1answer
47 views

Magento 2 - Change top navigation submenu position

I create a new theme for Magento 2 based on Luma theme. I change the submenu of the top navigation to be 100% width. .navigation .level0 .submenu { max-width: 1280px; width: 1280px; ...
0
votes
0answers
39 views

Magento 2 layout xml is not working

I am creating page layout using xml <referenceContainer name="content"> <container name="page.container.main" htmlTag="div" htmlClass="page-container-main" before="-"> <...
0
votes
0answers
14 views

Magento2 footer link not coming properly

My question is related to magento's default behavior. I have added footer custom link my action is blog_index_index. XML code is <referenceBlock name="footer_links"> <block ...
3
votes
1answer
43 views

Magento 2: How can I use two blocks in my homepage?

How can I use two different blocks in my homepage? this code doesn't work: <referenceContainer name="content"> <block class="Magento\Cms\Block\Block" name="test1"> <...
2
votes
2answers
42 views

Add custom div before main content in magento2

I am trying to add my custom div with class and id before the maincontent. <main id="maincontent" class="page-main"> can i add the custom div before this line? How this can be done. Please ...
0
votes
0answers
9 views

How to modify meta data of custom admin grid in Magento 2

I want to hide the Massaction of custom admin grid for some users. How to modify the layout in php?
1
vote
1answer
23 views

magento 2 widget layout update : specified pages section not showing all cms pages

I have created widget that i want to show on sidebar of about us and our company page, but in widget layout update >> specified pages section i can not find any option to see any option of My Cms ...
2
votes
1answer
21 views

How to add a custom block to the quick cart in Magento 2

I need to add a custom block to the quick cart / mini cart so that a message can be displayed. What XML would I need to amend?
2
votes
0answers
46 views

Upgrading from 2.2.5 to 2.2.6 several problems encrypt key exceed 32 character and layout

I'm working on upgrading my store from 2.2.5 to 2.2.6 I'm following this with my cron jobs of https://devdocs.magento.com/guides/v2.2/comp-mgr/cli/cli-upgrade.html first problem arises at php bin/...
1
vote
1answer
49 views

Magento2 - Override Template order summary in sales email order

I have the template that is using the following to render order summary {{layout handle="sales_email_order_items" order=$order area="frontend"}} it is taking the code from the following template ...
1
vote
2answers
29 views

Magento 2: how to move the category add to wishlist and compare actions next to the price

I'm struggling with a theme change. I would like to move the add to wishlist and add to compare actions from next to the add to cart button to next to the price. what my theme (unfinished) looks like ...
2
votes
1answer
25 views

How can i make sure the css is added to my theme , it is not working

I have css file design/theme/web/style.css but it is not working or maybe the thing i am adding is not responding . i have tried my own css in header of the theme it is working there but i know it is ...
3
votes
2answers
39 views

Block fails on (live) server but works on localhost?

I've added a custom block to catalog/product/view.phtml using echo $this->getLayout()->createBlock('colorchart/colorchart')->setTemplate('colorchart/colorchart.phtml')->toHtml(); and it's ...
1
vote
2answers
36 views

Magento 2 parent theme behavior

we have a complex shop structure with an multishop base theme from scratch and about 10 child themes. The structure is as follows: multishop_theme/ default (main theme content) child theme 1 (other ...
0
votes
1answer
23 views

How to include LESS in specific page layout

I have created my custom page_layout in magento 2 and now I want to add some less only in my page_layout. I don't want to load those less file in other layouts. How I can achieve it?
3
votes
1answer
33 views

Magento 2 - How can i move the category page title to the top of the catalog nav block on left?

I need to add the page title on the top of sidebar navigation block, i tired with the following but still it renders below the layered navigation. <move element="page.main.title" destination="...
2
votes
3answers
196 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?
0
votes
1answer
42 views

How to assign different template to product detail page of specific category in Magento 2

I have created two category "wine" and "events". I added product to each category and now I want to apply different template/design to product view page according to category. Products in event ...
0
votes
2answers
39 views

Blank Page with Front End Template in Controller

I have a controller that needs to display text, but I get a blank page. Here is what I have: Controller/Index/Index.php namespace Veratad\AgeVerification\Controller\Index; use Magento\...
0
votes
0answers
10 views

Magento 2: Add custom JS based on product id via XML

I am trying to load a JS-file based on a product id in Magento 2.1.7. I used the following approach: <head> <catalog_product_view_id_1> <link src="css/one.js" /...
0
votes
2answers
20 views

Custom CSS not loading

I created a custom css file in Vendor/theme/web/css and added css/custom.css to my default_head_blocks.xml file. Im in developer mode but I still ran static content deploy -f. I cleaned/flushed cache. ...
0
votes
1answer
45 views

Magento 2 - Display search button

I need to add a icon instead the search input form and when I click on this icon to display the search input form? something like minicart.
1
vote
0answers
13 views

Control visibility of layout Block on the basis of session value

I want to display a layout block only when there is some attribute is set in customer session. It can be controlled with a config value. Is it possible to do it with session too?
1
vote
2answers
45 views

How to move Review Block after Price Magento 2.0

How can i move "Be the first to review this product" block after Price block? My catalog_product_view.xml file code look like <page layout="1column" xmlns:xsi="http://www.w3.org/2001/...
2
votes
0answers
38 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 ...
0
votes
2answers
29 views

I want to create a custom tab on product view page in magento 2

I want to create a custom tab on product view page in Magento 2 and inside that tab I want call phtml files of another modules <referenceBlock name="product.info.details"> <block class=...