Modified the options passed to the templates for a correct behaviour of the links to go to the query view.