use templates to generate advanced search form