spray / twirl

The Play framework Scala template engine, stand-alone and packaged as an SBT plugin
Apache License 2.0
215 stars 20 forks source link

Support includes #6

Closed analytically closed 11 years ago

analytically commented 11 years ago

Currently twirl does not support includes, as like the Play documentation:

Again, there’s nothing special here. You can just call any other template you like (and in fact any other function coming from anywhere at all):

Home

@common.sideBar()
sirthias commented 11 years ago

No, twirl supports includes. Check out this example for the spray site: https://github.com/spray/spray/blob/master/site/src/main/twirl/header.scala.html#L24

analytically commented 11 years ago

Have you tried using subdirectories? e.g. elements/jquery.scala.html -> @html.elements.jquery()

sirthias commented 11 years ago

Check out this section of the README: https://github.com/spray/twirl#package-names

Twirl handles sub-packages differently from the play engine. Try elements.html.jquery().

analytically commented 11 years ago

Damn sorry for the noise. The package paragraph should include an example of an include.