I have created a custom module which shows some custom product listing and banner data. I have created a system setting to set those things in homepage or use default one. Now what i want if admin select use custom module homepage then existing content will be unset or remove and new content will be shown. below is my cms_index_index code. which insert that block in cms page content area and things come up but how can i remove existing content before showing those things.

<?xml version="1.0"?>
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">


        <referenceContainer name="content">
            <block class="Hello\Pageconfig\Block\Pageconfig" ifconfig="pageconfig/settings/use" name="hello.configured.homepage"/>

Your Answer

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

Browse other questions tagged or ask your own question.