Reputation: 1095
I have dynamic content that I would like to display on every page in my application. I'm only using one template(main.html). I can render the content for every controller and then main.html has access to it, but I figure there has to be a cleaner way to include content outside of the doLayout tag.
Upvotes: 1
Views: 1161
Reputation: 54924
The most common way to do this, is to use a @Before interceptor in your controller to get the dynamic elements, and to store it in the renderArgs, and then to place the dynamic content in your view by editing the main.html.
I think the question answers your question succinctly - Does Play Framework support "snippets"?.
Upvotes: 2
Reputation: 1725
As doLayout is a custom tag, you can create a new one of your own and have any content you need, within your logic.
Upvotes: 0