How to add a custom container only on certain pages?

Hi, I’d like to add my custom container only to a certain page. In my case I want to add a banner to the homepage. I added my main.content.banner container before main.content which places the container correctly.

<page layout="1column" xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="page.wrapper"> <container name="main.content.banner" before="main.content" > <block class="MagentoFrameworkViewElementTemplate" name="main.content.banner.banner" template="Magento_Theme::html/custom.phtml" /> </container> </referenceContainer> </body> </page> 

Here is an image:

However, I want this container only to be on the homepage. Not on the other pages (like category page). The problem is, how would I tell M2 that I want my custom container only on top of main.content of homepage but not of other pages?

Is that even possible?

Thank you

submitted by /u/zlep
[link] [comments]