There is properly working custom module (as far as I'm concerned), that outputs map. I need to display it only at main page at the content container.

Now it outputs at every page content container.

What was done

First of all, I supposed, that it is doing by changing extended layout in the theme.

  1. At:


was written:

<?xml version="1.0"?>
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        <referenceContainer name="content">
            <block class="<Vendor>\Map\Block\Map" name="map" template="<Vendor>_Map::map.phtml">

I saw, that I can control displaying by changing the name, so i tried to use quite a lot of options, that PhpStorm gave me (especially with *.main.*).

  1. The second option was to create custom container and move it, but in process I realised, that I can't select destination at the particular page.

The problem was in incomplete understanding of Magento2 layout system.

Found an answer at:

Magento 2 - Custom Page Layout

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.