Common Template Library
        Posted  
        
            by 
                user1257547
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user1257547
        
        
        
        Published on 2012-03-08T16:59:11Z
        Indexed on 
            2012/03/21
            17:29 UTC
        
        
        Read the original article
        Hit count: 254
        
scala
|playframework-2.0
I'm trying to create a view that only houses reusable HTML blocks that can be used by other views. Wanted to know if something like this is possible:
In views.home.common.scala.html:
@component1 = {
  some common html
}
@component2 = {
  some other stuff
}
In views.home.sample.scala.html:
@(user:User)
import home._
@component1
@common.component2
Haven't had any luck thus far and I don't see anything similar in the samples but the idea is covered in the Template common use cases.
© Stack Overflow or respective owner