In Play! Framework v. 1.x there was such thing like a ‘tag’ where was possible to reuse some thml/template code.
In Play! Framework v 2.x, for me it is not clear still how it’s going to be used (here).
For example, I want to use tag to define a header for my site (in order not to repeat myself, but just include the header every in the pages where I need it).
Could someone explain me / show how to use tags, or whatever I should use to include the header or any block of html/template code.
You showed us a sample and you are asking for sample 🙂
That’s easy, create a common view in
views.tagspackage (remember to leave first line empty if you’re not gonna to pass any params! also remember to add brackets after tags name):/app/views/tags/header.scala.html
So you can ‘include’ it in any other view just with: