-
AuthorPosts
-
June 26, 2018 at 6:22 pm #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
June 26, 2018 at 7:40 pm #978108Hey Steve,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaJune 29, 2018 at 10:38 am #979251Hey 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,
SteveJuly 2, 2018 at 2:55 pm #980107Hi 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,
NikkoJuly 2, 2018 at 3:24 pm #980115Hi Nikko,
Here’s what I added to the codeblock:
<form action=”http://rtmachinery.co.uk/?s=/” 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>July 3, 2018 at 7:11 pm #980701Hi,
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,
DudeJuly 4, 2018 at 10:33 am #981050That’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?
July 6, 2018 at 9:40 am #981931Hi 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,
NikkoJuly 6, 2018 at 9:50 am #981938Hi 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,
SteveJuly 8, 2018 at 5:11 pm #982728Hi Steve,
Here is a thread for you to consider
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.