I want to make 1 column layout for search result page when result not available.

How can i achieve this?

1 Answer 1


You can create a block rewriting the search results page say


and in that

public function getNoResultText()
        if ($this->catalogSearchData->isMinQueryLength()) {
            return __('Minimum Search query length is %1', $this->_getQuery()->getMinQueryLength());

        return $this->getLayout()->getBlock('zero_res');

Now create:-


<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <referenceContainer name="content">
        <block class="Custom\Handles\Block\Result" name="zero_res" template="zero_res.phtml"/>

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.