Can anybody point me to a nice Magento 2.3 tutorial on how to create an empty layout?

The idea is to place my report on a template that doesn't include the header and footer the rest of the site uses, not even the default CSS and JS files. The page I'm going to create would look like the Checkout page (no distractions.)



This should get you most of the way


<?xml version="1.0" ?>
<page layout="empty" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <meta name="robots" content="NOINDEX,NOFOLLOW"/>
        <remove src="mage/calendar.css"/>
        <remove src="requirejs/require.js"/>
        <remove src="css/styles-l.css"/>
        <remove src="css/styles-m.css"/>
        <remove src="css/styles-s.css"/>
        <remove src="css/print.css"/>
        <remove src="requirejs/require.js"/>
        <remove src="mage/requirejs/mixins.js"/>
        <remove src="requirejs-config.js"/>
        <remove src="mage/polyfill.js"/>
        <css src="Xigen_NotFound::css/notfound.css"/>
        <referenceContainer name="page.wrapper" remove="true"/>
        <referenceBlock name="translate" remove="true"/>
        <referenceBlock name="requirejs-config" remove="true"/>
        <referenceContainer name="root">
            <block class="Xigen\NotFound\Block\Not\Found" name="not.found" template="Xigen_NotFound::not/found.phtml"/>

You can probably see but removed most of the content including header

  • It works. Thanks. – luenib Jul 20 '20 at 15:26

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.