Magento custom "no results" search page

magento

Solution

i had the same issue: I hated that it was not easy to customise 'empty' pages i.e. empty search results, category pages and basket page. So I made an extension a while back for this: https://github.com/drewhunter/EmptyHandles . Essentially, it gives you 3 extra layout handles:

- catalogsearch_result_index_empty

- catalog_category_view_empty

- checkout_cart_index_empty

So in your specific case, you would use the following xml to change the template on an empty search results page after installing the module:

   <catalogsearch_result_index_empty>
        <action method="setTemplate">
            <template>page/1column.phtml</template>
        </action>
    </catalogsearch_result_index_empty>

Problem

Is there a way to define a custom template for the "no results" view of the Magento search? The thing is that I want to use a 1 col layout if there's no result in a search, and 2 col if there is a match. Cheers!

Original source