Play Framework implements a complete APP (5), frameworkapp
The program is available and the page needs to be improved.
1. Create a Page Template
Create a fileApp/views/tags/display.html
*{ Display a post in one of these modes: 'full', 'home' or 'teaser' }* <div class="post ${_as == 'teaser' ? 'teaser' : ''}">
Modify index.html
#{extends 'main.html' /}#{set title:'Home' /} #{if frontPost} #{display post:frontPost, as:'home' /} #{if olderPosts.size()} <div class="older-posts">
2. Modify Layout views \ main.html
<!DOCTYPE html>
3. Add methods in Application. java and add elements on the page
@Beforestatic void addDefaults() {renderArgs.put("blogTitle", Play.configuration.getProperty("blog.title"));renderArgs.put("blogBaseline", Play.configuration.getProperty("blog.baseline"));}
Add and render blog. title blog. baseline
4. modify the configuration file conf \ application. conf.
# Blog engine configuration# ~~~~~blog.title=Yet another blogblog.baseline=We won't write about anything
5. Add a Page Style
CSS: http://play-framework.herokuapp.com/zh/files/main.css
Add/Public/stylesheets/main.css
Running effect:
..