There is still a minor issue: the 'search' action already uses a view, hence the result is an html snippet. It is that snippet which I would also like to use when rendering the complete layout.
You are right, I could have a function in the controller to generate this html snippet, but I think it does not belong there, since controllers pass data to views but should not contain/generate html.
While writing about this I am realizing that a widget might be the best solution.