Play Framework implements a complete APP (5), frameworkapp

Source: Internet
Author: User

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:

 

 

 

..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.