We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2623
    • 34 Posts
    Hello,

    My first atempt wih Ajax Search and I’m bumping into some minor issues.
    I want to use a search field in my header div, but since the results are displayed below the form, all warnings and search text show in the header. A bit messy embarrassed :

    http://alazao.com.br/mod/index.php

    If I try to show the form on my results page, it also breaks the header div. Is there a way around this?

    I’ve temporarily removed the form from the results page:
    http://alazao.com.br/mod/index.php?id=8

    I’m using a chunk for search call on my template header:
    [!AjaxSearch? &ajaxSearch=`0`!]

    I’ve edited the snippet config file, setting the landing page value and it works fine.
      • 2623
      • 34 Posts
      A bit of trial and error and the solution to my prob is quite easy smiley

      Use a custom template in your call, like so:
      [!AjaxSearch? &ajaxSearch=`0` &tplLayout=`@FILE:assets/snippets/ajaxSearch/templates/my_custom_template.tpl.html`!]

      In my case, my template only kept the form markup:
      [+as.showForm:is=`1`:then=`
      <form [+as.formId+] action="[+as.formAction+]" method="post">
          <fieldset>
      		<input type="hidden" name="advSearch" value="[+as.advSearch+]" />
          <label for="ajaxSearch_input">
            <input id="ajaxSearch_input" class="cleardefault" type="text" name="search" value="[+as.inputValue+]"[+as.inputOptions+] />
          </label>
          <label for="ajaxSearch_submit">
            <input id="ajaxSearch_submit" type="submit" name="sub" value="[+as.submitText+]" />
          </label>
          </fieldset>
      </form>
      `+]
      


      Thank you, Coroico for this! Very nice!