I would like help working out how to add a custom container as a 'Layout Update' for a widget..

Currently, I only have the 3 basic options to choose from (Main Content Area, Siderbar Main and Sidebar Additional), but I would like to be able to add widgets to containers that I've created through various default.xml files.

Specifically, I'm trying to include the Recently Viewed widget. I have tried updating module-reports/etc/widget.xml, adding an extra inside the , however that doesn't seem to work..

How can I use a customer container?

Thanks, Luke

2 Answers 2


As it turns out, the custom container that I had created didn't have a label attribute, so Magento was ignoring it as a possible layout destination


Note: The below has been tested up to Magento 2.2.8

I had a similar issue and have build a module to do this exact same thing, but it's in a private repository so I can't give you the link, I can however give you the code; note I've changed the namespace to LD (shorthand for Luke Denton - it can be whatever you want, as long as it's consistent). Simply upload the below files to app/code/LD/Reports





<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="LD_Reports" setup_version="1.0.0">
            <module name="Magento_Reports"/>


<?xml version="1.0" encoding="UTF-8"?>
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    <widget id="recently_viewed">
            <container name="my.additional.container">
                <template name="default" value="list_default" />
                <template name="names_only" value="list_names" />
                <template name="images_only" value="list_images" />

Then in your theme you need a container with a corresponding name and label.

  • 1
    I can confirm it works for 2.2.8
    – Daniel
    Commented May 8, 2019 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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