Skip to content

Instantly share code, notes, and snippets.

@roman204
Created March 27, 2018 09:01
Show Gist options
  • Save roman204/557725b9aaf05986685959f4bd153c7b to your computer and use it in GitHub Desktop.
Save roman204/557725b9aaf05986685959f4bd153c7b to your computer and use it in GitHub Desktop.
layout file for search field when Magento2 got Smile_ElasticSuite and Ultimo Theme
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="footer_links" remove="true" />
<referenceContainer name="header-wrapper">
<block class="Smile\ElasticsuiteCore\Block\Search\Form\Autocomplete" name="top.search" as="topSearch" template="Smile_ElasticsuiteCore::search/form.mini.phtml">
<arguments>
<argument name="rendererList" xsi:type="array">
<item name="term" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Search terms</item>
<item name="template" xsi:type="string">Smile_ElasticsuiteCore/autocomplete/term</item>
</item>
</argument>
</arguments>
</block>
</referenceContainer>
<referenceBlock name="top.search">
<arguments>
<argument name="rendererList" xsi:type="array">
<item name="product" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Products</item>
<item name="template" xsi:type="string">Smile_ElasticsuiteCatalog/autocomplete/product</item>
</item>
<item name="category" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Categories</item>
<item name="template" xsi:type="string">Smile_ElasticsuiteCatalog/autocomplete/category</item>
</item>
<item name="product_attribute" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Attributes</item>
<item name="template" xsi:type="string">Smile_ElasticsuiteCore/autocomplete/term</item>
<item name="titleRenderer" xsi:type="string">Smile_ElasticsuiteCatalog/js/autocomplete/product-attribute</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment