Questions tagged [containers]

Denotes questions related to Magento 2 containers.

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

Magento2: How to execute Cron in non-root container on Kuberentes?

I've used the Bitnami Magento Helm chart to install Magento 2 on the Kubernetes cluster. By default, the pod and the container are configured not to use root users which is good from a security point ...
Soron's user avatar
  • 1
0 votes
2 answers
62 views

Can we add extra container to page header in Magento 2?

I need to add a extra container to page header. https://prnt.sc/dq9LDPcioxvJ please check attached screenshot.
kiran's user avatar
  • 527
1 vote
2 answers
397 views

Elasticsearch 7.11 connection refused using Devilbox

I'm starting the Elasticsearch 7.11 in my linux, and it works when i run curl -XGET localhost:9200 INSIDE MY LINUX. But the issue is, i'm trying to access this Elasticsearch service started in my ...
Rafael Fagundes's user avatar
0 votes
2 answers
1k views

How do I place a widget in a custom page layout?

I've created multiple custom pages like a contact page and FAQ page but both the pages and the containers I've labeled don't show up in the widget panel. What's the right way to add widgets to your ...
Alphaegen's user avatar
0 votes
1 answer
1k views

How to create a docker image of an existing Magento 2 website running with Apache/PHP7.2/MySQL/ubuntu 18.04 version

We have a Magento 2 website and are trying to deploy the website as docker containers running in Kubernetes in GCP. At present, we have the website set up with a LAMP. So I believe we need to have the ...
Sandeep S's user avatar
0 votes
1 answer
2k views

Magento 2: Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Perfectmirrors\PmmLayout\Block\Head

I am really not sure how to create the block class Pmm\PmmLayout\Block\Head , function of which $block->getAllPagesJSContent() should be called inside my phtml file pmm_head.phtml <...
CodeForGood's user avatar
0 votes
1 answer
39 views

container after instruction doesn't work for some elements

I have created a custom theme from scratch, everything works perfectly except one thing, in my home page Vendor/Theme/Magento_Theme/layout/default.xml I can't place my 'main' container after my '...
ChristopheS's user avatar
0 votes
1 answer
498 views

Magento 2 - new container not showing in overriden layout file

I try to change the layout vendor\magento\module-catalog\view\frontend\layout\catalog_product_view.xml in my own theme. I have overriden the layout file completly: app\design\frontend\company\base\...
Black's user avatar
  • 3,100
0 votes
1 answer
444 views

Magento 2- Add custom container into product listing page

I've search for some answers to this but unfortunately I can't seem to find anything. I would really appreciate some help about this. I have created a custom container using XML in '...
Spas Velinov's user avatar
0 votes
3 answers
314 views

How to move existing links and add new custom links in top header?

I already check many answers regarding the move header.links to header-wrapper its working but the problem is that it also move my custom links to header content. I am trying to create a new ...
Sagar Parikh's user avatar
1 vote
2 answers
985 views

Adding a block inside a block already in a container

I have a third-party module and I'm trying to inject a block of my own (a CMS block) between two of their blocks. I'm doing something wrong because I can get my block to appear at the very end or the ...
S Adamson's user avatar
  • 699
0 votes
3 answers
2k views

How to create an empty container and render it

I want to create an empty container and get it rendered. Currently my empty container isn't showing up. <container name="empty-container" htmlTag="div" htmlClass="my-class"/>
Quisse's user avatar
  • 850
0 votes
1 answer
2k views

Running a script inside a docker container using shell script from host

I am new to Docker technology,I am trying to create a shell script on my host to clear caches and to deploy my static content in Magento 2 inside my apach containe. to access to my apach container i ...
Salaheddine Radi's user avatar
2 votes
1 answer
242 views

Remove container in block class

I want to remove some items from a page when certain conditions apply. I got a solution but I'm wondering if there isn't any better way to do this. Now the code that I have is for each block that I ...
Arno Vande Cappelle's user avatar
1 vote
0 answers
846 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 ...
Haim's user avatar
  • 2,104
2 votes
5 answers
5k 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 ...
Aditya Shah's user avatar
  • 7,517
1 vote
0 answers
1k 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....
Purushotam Sharma's user avatar
0 votes
1 answer
408 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
Ajwad Syed's user avatar
  • 1,591
6 votes
2 answers
1k 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 ...
geerlingguy's user avatar
0 votes
1 answer
170 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 ...
Ajwad Syed's user avatar
  • 1,591
2 votes
2 answers
5k 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:...
Ajwad Syed's user avatar
  • 1,591
0 votes
3 answers
881 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="...
Francesco's user avatar
2 votes
1 answer
391 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....
Ynhockey's user avatar
  • 265
1 vote
1 answer
510 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()->...
glafche's user avatar
  • 487
2 votes
1 answer
932 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", <...
Ajwad Syed's user avatar
  • 1,591
0 votes
1 answer
1k 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 ...
Madn3ss795's user avatar
2 votes
1 answer
897 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 ...
PЯINCƎ's user avatar
  • 11.6k
0 votes
0 answers
90 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 ...
riksof-zeeshan's user avatar
1 vote
1 answer
2k 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/...
Ajay Patel's user avatar
  • 1,503
0 votes
1 answer
471 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 ...
Slimshadddyyy's user avatar
2 votes
1 answer
471 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 ...
Key Shang's user avatar
  • 3,365
1 vote
1 answer
4k 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 ...
kia4567's user avatar
  • 217
4 votes
2 answers
10k 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 ...
kia4567's user avatar
  • 217
0 votes
1 answer
179 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....
Cake's user avatar
  • 346
2 votes
0 answers
588 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....
Julien's user avatar
  • 21
1 vote
2 answers
3k 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/...
Abhishek Tripathi's user avatar
3 votes
2 answers
4k 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 ...
Tom's user avatar
  • 181
0 votes
1 answer
3k 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 ...
CreativeNerdSam's user avatar
1 vote
1 answer
334 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-...
lky's user avatar
  • 767
1 vote
1 answer
880 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 ...
Joseph Hovik's user avatar
0 votes
1 answer
298 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 ...
Prince's user avatar
  • 91
0 votes
1 answer
904 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"&...
Magento Developer's user avatar
1 vote
1 answer
625 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" ...
alobeejay's user avatar
  • 467
1 vote
1 answer
2k 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"> <!-- ...
andy jones's user avatar
  • 1,383
0 votes
1 answer
548 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', ...
dbcn's user avatar
  • 744
3 votes
1 answer
3k 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/...
davideghz's user avatar
  • 683
0 votes
1 answer
2k 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 <?...
Marko Niciforovic's user avatar
2 votes
1 answer
3k 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 ...
Riyas Muhammed's user avatar
4 votes
3 answers
12k 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 ...
user159500's user avatar
2 votes
2 answers
8k 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 .... </...
Anna's user avatar
  • 1,645