i have a few questions about Templates. I think i didn't understand exactly how they work. Let's say I have a Website which consists of the navigation on the left side, a display in the middle and a header with additional navigation. So I have the following templates:
- main.scala.html
- navigation.scala.html
- header.scala.html
- display.scala.html
main.scala.html contains the general structure of the site. It gets the navigation, header and display as parameters. So the first line in the main would be:
@(navigation: html)(header: html)(display: html)
Am I right?
If I want to view the whole page, I will just call ok(main.render()) in my controller.
However, how can I change the navigation on my website? When I create a new template, lets call it newNavigation.scala.html and I call ok(newNavigation.render()) in my controller, I'll get the problem, that I only pass the newNavigation template to the main and the main misses the header and the display.
The navigation template as well as the header and display look like:
@main{
...
}
And how can I load a different display and navigation on the same time?
I'm sorry for my English and I hope someone could help me, thank you.
Playtemplates? Tagging is important to make sure the right people see your question. - Dylan