You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 9, 2019. It is now read-only.
I made my own templates for instantsearch and autocomplete and in the process moved all of the JS into a file instead of injecting it inline. I expected the Algolia config to be available via localization so that I could use it on my JS files.
What happened instead?
The template loader injects the config localization in wp_head instead of through wp_enqueue_scripts so I cannot change the priority order to have the config come before any JS is loaded. I was able to get my results showing by putting my custom JS in the footer and leave the config in the header. The downside to this is the DOM loads the markup as empty containers, then a second later, flashes in the search results. I would think it would be more seamless if the JS files and the config parameter are loaded in the head.
Any idea on how I can get around this problem?
Seems to me like the localization should be using the wp_enqueue_scripts hook instead of wp_head
Technical info
WordPress version: 4.9.8
Algolia Search plugin version: 2.11.2
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What did you expect to happen?
I made my own templates for instantsearch and autocomplete and in the process moved all of the JS into a file instead of injecting it inline. I expected the Algolia config to be available via localization so that I could use it on my JS files.
What happened instead?
The template loader injects the config localization in
wp_head
instead of throughwp_enqueue_scripts
so I cannot change the priority order to have the config come before any JS is loaded. I was able to get my results showing by putting my custom JS in the footer and leave the config in the header. The downside to this is the DOM loads the markup as empty containers, then a second later, flashes in the search results. I would think it would be more seamless if the JS files and the config parameter are loaded in the head.Any idea on how I can get around this problem?
Seems to me like the localization should be using the
wp_enqueue_scripts
hook instead ofwp_head
Technical info
The text was updated successfully, but these errors were encountered: