[2.0] - common assets/routes in multiple play projects, mega project?

66 views
Skip to first unread message

franklovecchio

unread,
May 3, 2012, 2:12:23 PM5/3/12
to play-framework
I'm having a hard time understanding this thread in terms of my use
case: https://groups.google.com/group/play-framework/browse_thread/thread/4ebf0d84a6879a2c

Let's look at like this: I have multiple websites that use common
items, e.g. bootstrap, backbone, html5boilerplate, underscore, jquery,
and sass when I write the parser :)

My "common" Play 2.0 project holds all the above assets, and looks
like:

/common
/app/
/views
main.scala.html (This file is a base template, no styling, that
all of my websites need to use)
/public
/backbone/..
/javascripts/..
/underscore/...

In my "website-1" Play 2.0 project, I want to have an index.scala.html
file that calls: "@main("website-1") { do my website-1 layout here }".
Does Play 2.0 know how to do this? What is the point of separate
projects/modules if I can't do this?

From what I read on that thread, it looks like I could create a Play
2.0 project that holds all of these together, and place them in the
same directory. The setup looks like:

/common
/website-1
/website-2 ...etc.
/mega-website-play-application

Now, I can't quite figure out how to run the Play 2.0 mega-website-
play-application and mesh all this. I'm not sure how to setup the
routes, either, as the docs are a little sparse, and sometimes the
broken english is confusing :)

If I have a single route in "mega-website-play-application" which
determines where to push the user, either to "website-1" or
"website-2", can I leave the routes for "website-1" and "website-2" in
their respective projects?

routes "mega-website-play-application"

GET / controllers.Application.index() # Determine wtf to send
the user, then redirect

routes "website-1"

GET /website-1 controllers.Application.index() # (of website-1
Play 2.0 app)

routes "website-2"

GET /website-2 controllers.Application.index() # (of website-2
Play 2.0 app)



Please help!
Reply all
Reply to author
Forward
0 new messages