How I can define target="_self"> for Algolia search in out website?

Hi Guys,

Morning to you all. My question might be very basic but I am struggling to define target=“_self” for algolia search pages. Could you please suggest how I can do this?


Hi @sant.rathaur!

I may need more context for your question. Is this within InstantSearch? Are you trying to use it for going from results to results? Do you happen to have a CodeSandbox or equivalent?

hey mate, Thanks for checking.

In have attached the screenshot for you and this is our website URL:

So basically, when someone clicks on search result (displayed programs in the screenshot), we want that page to open in the same window but we are unable to achieve it as we are unsure where we can define target=“_self”. Do we need to define it in the Algolia platform or our CMS somewhere?

Thanks again,

You can control how the link works by tweaking the rendering logic for your hits within your application. For instance, this is how you would do it using our InstantSearch frontend library:

It looks like you may have built a custom frontend? I see you have target="blank" within the search-result_tile objects in your data-search-results div. That’s where you’ll want to make the change.

Thanks mate… We will give it a try and will let you know it that solves our problem.


1 Like