Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #978060

    Hey guys,

    The Ajax Search Function works perfectly on my site. However…

    However… I’ve added another search bar inside a Code Block and placed it on my homepage.

    It looks perfect and performs searches fine. However, the Ajax function doesn’t appear to work like it does in the site header?

    Steve

    #978108

    Hey Steve,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #979251

    Hey Victoria,

    Unfortunately, you won’t be able to see the site until it goes live. The site is being stored and developed in a bizarre way!

    I’ve had to edit my browser host file in order to gain visibility of the site in order to work on it.

    See screenshots attached regarding my Ajax Search issue. Screenshot 1 (https://ibb.co/fOzAsJ) shows the function working perfectly in the header. However, screenshot 2 (https://ibb.co/n8Ezmd) shows the search bar not working correctly when placed in a Code Block on my site homepage.

    I’d like the search function to display results whilst the user types. It works fine in the header, but not on the page itself.

    I can give you FTP logins if they’re of any use?

    Many thanks,
    Steve

    #980107

    Hi Steve,

    I don’t think we will need ftp logins since we could not check the site.
    Can you tell us what code did you add in the codeblock to show the ajax search?

    Best regards,
    Nikko

    #980115

    Hi Nikko,

    Here’s what I added to the codeblock:

    <form action=”http://rtmachinery.co.uk/?s=/&#8221; id=”searchform” method=”get” class=””>
    <div>
    <input type=”submit” value=”” id=”searchsubmit” class=”button avia-font-entypo-fontello”>
    <input type=”text” id=”s” name=”s” value=”” placeholder=”Start your search…”>
    </div>
    </form>

    #980701

    Hi,

    This requires some work and testing. I’d recommend to use the search form code in enfold\config-templatebuilder\avia-shortcodes\search\search.php (line 776+) as a starting point. Note that the “avia_search_element” class of the wrapper div is important because the ajax function is bound to it (enfold\js\avia.js on line 35).

    Best regards,
    Dude

    #981050

    That’s great.

    So I simply need to replace my codeblock code with code from enfold\config-templatebuilder\avia-shortcodes\search\search.php (line 776+)

    Correct?

    #981931

    Hi goodinkcreative,

    I think that’s not what Dude meant but you can use that as a starting point to do what you’re trying to achieve.

    Best regards,
    Nikko

    #981938

    Hi Nikko,

    Apologies, I’m not sure what I need to do? I simply want to add a search box to my homepage that functions exactly the same way the search bar functions in the site header.

    On line 776 of the search.php file is the following code: (which doesn’t work in my codeblock)

    if ( !empty($results_style) ) {
    $results_style_str = json_encode($results_style);
    $results_style_attr = ” data-results_style='{$results_style_str}'”;
    }

    Please, can you explain as simply as possible what I’d need to do to add an additional search bar to my site.

    Many thanks,
    Steve

    #982728

    Hi Steve,

    Here is a thread for you to consider

    If you need further assistance please let us know.
    Best regards,
    Victoria

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.