Skip to content

Commit dd23446

Browse files
committed
better handling of custom search input
1 parent 1fc5e03 commit dd23446

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

code/Model/Observer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ public function useAlgoliaSearchPopup(Varien_Event_Observer $observer)
5555
{
5656
$observer->getLayout()->getUpdate()->addHandle('algolia_search_handle');
5757

58-
if ($this->config->isDefaultSelector() === false)
58+
if ($this->config->isDefaultSelector())
59+
{
60+
$observer->getLayout()->getUpdate()->addHandle('algolia_search_handle_with_topsearch');
61+
}
62+
else
5963
{
6064
$observer->getLayout()->getUpdate()->addHandle('algolia_search_handle_no_topsearch');
6165
}

design/frontend/layout/algoliasearch.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
<reference name="content">
2222
<block type="core/template" before="content" template="algoliasearch/beforecontent.phtml"/>
2323
</reference>
24+
25+
</algolia_search_handle>
26+
<algolia_search_handle_with_topsearch>
2427
<reference name="top.search">
2528
<action method="setTemplate"><template>algoliasearch/topsearch.phtml</template></action>
2629
</reference>
27-
</algolia_search_handle>
30+
</algolia_search_handle_with_topsearch>
2831
<algolia_search_handle_no_topsearch>
2932
<reference name="head">
3033
<block type="core/template" template="algoliasearch/topsearch.phtml"/>

0 commit comments

Comments
 (0)