Advanced Settings

Adding a Custom Live-Search for Mobile

Check how to get live-search in your custom mobile search-field

In some DanDomain themes, the same search-field is rendered multiple times, to be used for both mobile and desktop.

This can be handled by inserting a new Live-Search embedcode, using the App's built-in event-handling, to make sure its added after the search-field is rendered.

In the DanDomain, navigate here:
Designs -> Skins -> Rediger Skin

In the second code-editor, choose Body (bund) and insert this script:

<script type="text/javascript">
function clerkBeforeRenderVariables() {
      '<span class="clerk" data-template="@live-search" data-live-search-categories="true" data-live-search-categories-title="Kategorier" data-live-search-products-title="Produkter" data-bind-live-search=".SearchField_SearchPage:eq(1)"></span>');

Notice that you might need to change the last part of the embedcode in the .SearchField_SearchPage:eq(1) as it depends on the mobile search-fields placement in the DOM.

:eq(0)  if its the first search-field in the DOM
:eq(1)  if its the second one and so on