Allow states variable to be accessed by parent template, only do search checks on search page.