Play! framework. template "include"

socksocket picture socksocket · Aug 1, 2012 · Viewed 12k times · Source

I'm planning my website structure as following:

  • header.scala.html
  • XXX
  • footer.scala.html

now, instead of "xxx" there should be a specific page (i.e. "UsersView.scala.html").
what I need is to include (like with well-known languages) the source of the footer and the header into the the middle page's code.

so my questions are:

  1. How do you include a page in another with scala templating?
  2. Do you think it's a good paradigm for Play! framework based website?

Answer

jparkcool picture jparkcool · Aug 11, 2012

Just call another template like a method. If you want to include footer.scala.html:

@footer()