Skip to content

Commit

Permalink
move live search from meta into body
Browse files Browse the repository at this point in the history
  • Loading branch information
Stubbe committed Sep 30, 2024
1 parent 58b58ef commit feafaf8
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/Resources/views/storefront/layout/meta.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -143,27 +143,26 @@
{% if config('clerkio64.config.instantSearchEnabled') == 'true' and config('clerkio64.config.instantSearchInjectionPosition') == 'meta' %}
<span
class="clerk clerk-move-to-body"

data-template="@{{ config('clerkio64.config.instantSearchContent') }}"
data-instant-search-suggestions="{{ config('clerkio64.config.instantSearchNumberOfSuggestions') }}"
data-instant-search-categories="{{ config('clerkio64.config.instantSearchNumberOfCategories') }}"
data-instant-search-pages="{{ config('clerkio64.config.instantSearchNumberOfPages') }}"
data-instant-search-positioning="{{ config('clerkio64.config.instantSearchDropdownPositioning') ? config('clerkio64.config.instantSearchDropdownPositioning') : 'left' }}"
data-instant-search="{{ config('clerkio64.config.instantSearchInputSelector') ? config('clerkio64.config.instantSearchInputSelector') : '.header-search-input' }}"
data-instant-search-pages-type="{{ config('clerkio64.config.instantSearchPageTypes') ? config('clerkio64.config.instantSearchPageTypes') : 'all' }}">
</span>
<script>
((w, d) => {
const move = d.querySelectorAll(".clerk-move-to-body");
if(move){
move.forEach(el => {
document.body.appendChild(el);
})
if(typeof w.Clerk == 'function'){
w.Clerk("content", ".clerk-move-to-body");
}
}
})(window, document);
</script>
</span>
<script>
((w, d) => {
const move = d.querySelectorAll(".clerk-move-to-body");
if(move){
move.forEach(el => {
document.body.appendChild(el);
})
if(typeof w.Clerk == 'function'){
w.Clerk("content", ".clerk-move-to-body");
}
}
})(window, document);
</script>
{% endif %}
{% endblock %}

0 comments on commit feafaf8

Please sign in to comment.