Hi community,
I’m attempting to set context on my client’s Jambo results page. I’m following the instructions in the Query Rules unit (under Jambo Search Results Page).
When I follow the steps to override the theme and select my after-init.js
file I’m left with an empty file. Based on the instructions, I’m looking for a section to set my context.
Could you let me know where to add the line to set my context, e.g ANSWERS.setContext({jobProspect: true, market: "Mid-Atlantic"})
; ?
Many thanks!
Max
Just to add some background: The reason I want to initiate context on the page itself, is because the client will not have a search bar on their site but rather link to the empty search result page from a search icon.
Hey Max,
The reason that file is empty is because it’s there for any custom code. You should be able to paste the context exactly where your cursor is in the screen shot on line 3:
ANSWERS.setContext({jobProspect: true, market: "Mid-Atlantic"});
The JS runs after Answers has been initialized.
Thanks Kristy, this worked like a charm