1

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 UI component, but I need some dynamic content, so I changed to a block.

Here's my profile_edit.xml file. I've written some print statements in the Tabs class as well as my profile class, but they aren't printing out. Magento just seems not to honor the entire "left" container.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>
            Create New Profile
        </title>
    </head>
    <update handle="styles"/>
    <body>
        <referenceContainer name="content">
            <block class="MyCompany\MyModule\Block\Adminhtml\Profile\Edit" name="mycompany_mymodule_profile_edit"/>
        </referenceContainer>
        <referenceContainer name="left">
            <block class="MyCompany\MyModule\Block\Adminhtml\Profile\Edit\Tabs" name="mycompany_mymodule_profile_tabs">
                <block class="MyCompany\MyModule\Block\Adminhtml\Profile\Edit\Tab\Profile" name="mycompany_mymodule_profile_edit_tab_profile"/>
                <action method="addTab">
                    <argument name="name" xsi:type="string">profile</argument>
                    <argument name="block" xsi:type="string">mycompany_mymodule_profile_edit_tab_profile</argument>
                </action>
            </block>
        </referenceContainer>
    </body>
</page>
1

You need to define layout="2columns-right" inside tag. So it would look like

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" layout="2columns-right">
  • Thanks MagentoFormat, it worked. As an aside, I ended up using the "admin-2columns-left" layout. <page xmlns:xsi="w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> – Joseph Hovik May 23 '17 at 16:50

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.