template and start of controller for search pagination