Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [containers]

Denotes questions related to Magento 2 containers.

0
votes
0answers
24 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
4answers
533 views

What is the functional difference of Block & Container in Magento 2?

Block vs Container functional difference. I have followed this url but doesn't clear much for me. Which type of classes are extended by block and container. Note : I know how containers and Block ...
1
vote
0answers
75 views

Magento 2: How to move block into html div?

I want to move below block in third "col-md-4 col-lg-4" div:- <block class="Magento\Catalog\Block\Product\View" name="product.info" template="Magento_Catalog::product/view/form.phtml" after="alert....
0
votes
1answer
114 views

M2 | How to find referenceBlock name for the Sales Order View : Account Information Section?

Part1: I need to know the referenceBlock name for: Part 2: and put a button at: “If you have knowledge, let others light their candles in it.” ― Margaret Fuller
1
vote
1answer
150 views

Scaling Magento 2 on multiple containers in production with generated code

I'm working on some auto-scaling Kubernetes infrastructure to run Magento 2, and I noticed that when I start new containers, I can't have the generated/ directory automatically compiled as part of the ...
0
votes
1answer
49 views

Magento 2 | Which refrenceContainer to use for adding additional button on 'Create New Order Page?

I am adding a new button with Add Products button at: Sales->Order->Create New Order->New Add Product Button as shown in screenshot! I searched for the relevant referenceContainer in vendor but all ...
0
votes
2answers
104 views

Magento 2 | When to use referenceContainer and when referenceBlock?

I am getting same output if I use referenceContainer or referenceBlock As <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
0
votes
3answers
71 views

Move block before Tab Magento2

i would like to create a banner on product view page and move this banner AFTER the short description and before the tab content. I user this code under catalog_product_view.xml <move element="...
1
vote
1answer
59 views

Conditionally removing a container

I am trying to replace the customer.login.container on the login page, which can be done through customer_account_login.xml by adding something like: <referenceContainer name="customer.login....
0
votes
1answer
59 views

Magento2: Is it possible to get a reference to containers and programmatically add blocks to them?

$block = $this->getLayout() ->createBlock('Magento\Framework\View\Element\Template') ->setTemplate('MyModule_ProductTile::widget\test.phtml'); $this->getLayout()->...
2
votes
1answer
282 views

In which referenceContainer of product page we add block for custom rich snippets of current product?

I have to extend default rich snippets for products. For this I have my script in .phtml file as: <script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "Product", <...
0
votes
1answer
340 views

Magento 2 : hide sidebar on mobile view

Magento 2.2.3 Theme: Luma My homepage uses layout: 2 column with left bar. I want to hide the image block ( CMS static block ) or whole sidebar container referenceContainer name="sidebar.main" from ...
2
votes
1answer
247 views

Why root block render automatically content in Magento 2

In Magento 1 we have the possibility the add a block in a root block so it will not be displayed because root is not a core/text_list block type (structural block), it doesn't render automatically the ...
0
votes
0answers
46 views

Find referenceContainer in Magento 2.1 module

This is my first attempt to write a Module for Magento 2.1 I have read the documentation for referenceContainer that is not very helpful, I would like to know how can I access and apply my change in ...
1
vote
1answer
360 views

Magento 2 : How to Remove Container Div From CMS Page

How to remove container block from cms page for particular layout. I have created new layout and apply on cms page but not able to customize it. Below my custom layout code: app/design/frontend/...
0
votes
1answer
99 views

Magento 2.2.2 - Add Custom Wrapper using XML

I need to add additional wrapper inside page.wrapper so that other containers will be inside by custom wrapper. app/design/frontend/Vendor/Theme/Magento_Theme/page_layout/1column.xml <?xml ...
2
votes
1answer
98 views

Add container under body directly in Magento 2

In Magento 2, I want add a new container right.sidebar under <body> directly, not under content container. Then move the block catalog.product.related to the new container. I write the codes ...
0
votes
1answer
1k views

Adding a new container to Magento 2 header-wrapper for main navigation

I'm trying to add a new container to Magento 2 and have a main navigation menu displayed in here (which I've created as a frontend block) then trying to add it to my own container where I can add a ...
5
votes
2answers
4k views

Creating a new container and placing it where I want in Magento 2

I've search for some answers to this but I can't seem to find anything. I understand how to create the container and then move the blocks in there (which I've done), so this article wasn't that ...
0
votes
1answer
103 views

Add container to custom page layout

I'm trying to add containers/blocks to a newly created page layout. However, they do not show up in the DOM at all: vendor/my/module/view/frontend/layouts.xml: <page_layouts xmlns:xsi="http://www....
2
votes
0answers
369 views

Magento2 : Page_layout Container And Widget Configuration

I'm new on Magento 2, I have created a custom theme and a custom page_layout in /app/design/frontend/[Vendor]/[ThemeDir]/Magento_Theme/page_layout/homepage.xml <referenceContainer name="page....
1
vote
2answers
2k views

Xml Element reference is not allowed here

I am new to Magento & I am using Magento version 2.1.7 in my Windows 8.1 system with Xampp while creating a new module I am getting an error in my XML file located in the app/code/vendor/module/...
2
votes
2answers
2k views

Magento 2 - Custom Homepage block not showing

I have developed a custom homepage layout and applied to the homepage. I've tried to add a created block in Magento_theme/templates/html/homepage.html but it is not displaying. Can anyone check ...
0
votes
1answer
1k views

Magento2: Wrap all contents under .page-wrapper in new container

Im trying to add a secondary div wrapper if you like underneath the .page-wrapper, for example: <div class="page-wrapper"> <div class="my-new-wrapper-div"> <!-- ALL OTHER ...
1
vote
1answer
201 views

How To Add Block Outside of Magento_Theme?

<container name="container" label="header-container" as="header-container" htmlTag="div" htmlClass="container"> <container name="header-options" label="header-options" as="header-...
1
vote
1answer
415 views

Reference container “left” not showing in Magento 2

I've written "Edit" page referencing this tutorial. https://github.com/mageplaza/magento-2-sample-module The top buttons are showing, but none of the "left" tabs are. I've gotten it to work with a ...
0
votes
1answer
132 views

Fetch product data by referenceContainer in product list page

I need to hide product price in product list page. By below code, I can hide price but I need some product data for condition. I have read that $block variable is available in block but I am using ...
0
votes
1answer
494 views

How to create new container inside <main> tag in magento 2?

I am working with magento 2 layout containers. I need to create a container inside and below <div class="columns"> . My HTML should be like below, <main id="maincontent" class="page-main"&...
1
vote
1answer
410 views

Magento 2 Layout XML <container> “as” attribute

What exactly is the "as" attribute in <container> for in a layout xml? When do I need to reference this one contrary to "name"? <container name="sidebar.additional" as="sidebar_additional" ...
1
vote
1answer
1k views

Adding top.links to new header container magento 2

I've added a new reference container inside of: Magento_Theme/layout/default.xml Here is my code for adding the new container: <referenceContainer name="header.container"> <!-- ...
0
votes
1answer
334 views

Admin page content not loading: latter doesn't exist

I'm running Magento 2.1.3, and am seeing empty page content in my custom module's admin page, with the error Broken reference: the '[layout element name]' element cannot be added as child to 'left', ...
3
votes
1answer
2k views

Magento 2 - wrap everything in a div

I need to wrap all my content in a div. I'm trying to add a container w/o any success. I created a child theme and a custom-home.xml config file as follow: <layout xmlns:xsi="http://www.w3.org/...
0
votes
0answers
1k views

Magento 2 Add block to custom layout via admin panel widget

I've made a custom theme and custom homepage layout that renders a custom container and inside it a block with a custom template: custom_homepage.xml inside Magento_Theme/page_layout folder <?...
1
vote
1answer
2k views

Is it possible to Change Container htmlClass by override Magento 2?

I have a container defined in a layout file, but in some case with help of other xml I would like to change its htmlClass value, is it possible by override or something ? or need to create new ...
3
votes
1answer
7k views

How to add extra container to page header in Magento 2

I am working on a new theme which is based on the Luma theme. I need to add a extra container to page header.my problem is that I can't identify how/where to add this. Can anyone advise on what page ...
2
votes
2answers
4k views

Additional wrapper inside page.wrapper

I need to add additional wrapper in my Magento2 custom theme layout, so it would be <div class="page-wrapper"> <div class="my-custom-wrapper"> ... all other cotainers .... </...
1
vote
0answers
76 views

Magento 2 - setting a container class programatically

How can I retrieve a container from the layout programmatically and then set/update the htmlClass? I would like to be able to do something like the following: $container = $layout->getContainer('...
9
votes
1answer
9k views

Magento 2: How to add text within container via XML

I am attempting to render a single line of text prior to a Link list in the footer. Creating a template file to do this seems to be a waste of resources for this task. As I understood it, I could ...
1
vote
1answer
1k views

What referenceContainer are the product page breadcrumbs in?

I want to add a banner to the top of all the product pages. So far I've added <referenceContainer name="columns.top"> to the default.xml that links to my template file. This displays the ...
2
votes
1answer
6k views

Creating custom header extending Magento blank in Magento 2

I am trying to create a theme with Magento Blank as parent in Magento 2 but I can't figure it out how to change the header with a custom one. I first remove header.container from magento blank and ...
7
votes
3answers
8k views

Is it possible to remove elements in a page layout in Magento2?

When I read the documentation on page-layouts (http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-types.html#layout-types-page) I see that the following instructions in this XML ...
3
votes
3answers
5k views

Magento 2 container custom attribute

Have hunted round for this but can't find an answer. As the title suggests I want to add a custom attribute to a container. I currently have a container in layout.xml as such; <container name="my....
1
vote
1answer
267 views

Extending container getting error on templates

after extending product main info container I do not see any add to cart form in product view. Checking the logs I see main.CRITICAL: Invalid template file: 'product/view/addtocart.phtml' in module: ...
1
vote
2answers
385 views

Create new containers and move inside others

How do I create a new container referencing a parent container and move inside other containers. What I try <referenceContainer name="content"> <container name="product.container" ...
6
votes
2answers
6k views

Magento 2: New container not showing

I'm trying to add a new container to a layout (extending Magento Blank) but it's not rendering in HTML. I added the following to: app/design/frontend/VENDOR/MYTHEME/Magento_Theme/layout/default.xml &...
9
votes
2answers
30k views

Move blocks to other container how to

Being newby I look for a workaround to move Sign in and Store switcher from header.panel to header.container. I just tried this code but won't work <referenceContainer name="header.container"> ...