Displaying "Search By Algolia" text in Autocomplete 1.x

Good day,

I’m working on getting our WP Search with Algolia plugin upgraded to Autocomplete 1.x and one thing that we’re trying to keep in place is the “Search by Algolia” text/logo as per required with https://support.algolia.com/hc/en-us/articles/4406981826065-Do-I-need-to-display-the-Algolia-logo-when-on-a-free-plan-

However, I’m not finding a way to append to the dropdown appropriately one time at the bottom. I know that templates have footer customizations, but that would be for each source instead of once.

I know I’m seeing that type of output on the docs site itself.

Any leads on where to append this information?

Wanted to bump this since I know I started it right before the Thanksgiving holiday in the US and staff may not have seen it yet. :slight_smile:


Here’s a basic example showing a footer template. We have some more information on the other templates here in our docs. Hope this helps! Let me know.

Yes and no. I think I may need to get crafty since this is for the WP Search with Algolia plugin that we maintain, and we have potentially 1 to many indices used in the getSources source. I’m thinking we may need to calculate when we’re on the last source and only utilize the footer template at that time. Otherwise we’d be outputting “Powered by Algolia” multiple times :smiley:

I believe I have enough with this, which we would use after we’ve iterated overall our potential sources.

let last = sources.length - 1;
sources[last].templates.footer = function ({state, html}) {
	return get_template('autocomplete-footer', '', html )

The “get_template()” is a custom function that we’re using to try and separate out code a bit. That said though, this does append to the last item like needed. Why I didn’t think of this one earlier, I dunno :stuck_out_tongue_winking_eye: