GithubHelp home page GithubHelp logo

dddpaul / play-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codeborne/play-web

0.0 2.0 0.0 1.8 MB

Play Framework 1.2.x module that helps creating web sites

License: GNU General Public License v3.0

play-web's Introduction

play-web

Module for Play framework 1.x for adding of website capability based on git to your project with some WYSIWYG CMS features.

Adding to dependencies.yml

require:
  - play
  - play -> secure
  - play-web -> web 1.5.4

repositories:
  - codeborne:
    type: http
    artifact: http://repo.codeborne.com/[organization]/[module]-[revision].zip
    contains:
      - play-web

Web content

This module expects that your web content is located in a separate git repository from your code (because it can get very large and will probably will be committed to by non-developers).

The directory structure of web content will correspond to the URL structure.

http://youdomain.com/en/mega-page  -> YOUR-WEB-CONTENT-DIR/en/mega-page

A directory under web content is a valid web page if it contains file metadata.properties, eg:

title: Tartu Maraton
order: 1
template: custom

All of the properties are optional.

Configuration

Add these lines to your application.conf:

web.content=../YOUR-WEB-CONTENT-DIR
cron.webContentPull=0 */5 * * * ?
web.en.home=/en
web.ru.home=/ru

Web layout

In order to specify how your web site will look like, you need to add some html files to app/views/Web.

First mandatory file is layout.html, which will be the base of all web content (it can extend main.html if you want same look for web app and web site):

#{extends 'main.html'/}
#{doLayout /}

Each page may have a different page template, depending on the template name specified in metadata.properties.

Template files must reside in app/views/Web/templates

As a minimum, you need to have custom.html there, which is the default page template name.

If you want to just extend your project's main.html for your web content as well, then create custom.html like this:

#{extends 'Web/layout.html'/}
#{get 'content'/}

This will just display the content.html that is located in the page's directory without any additional layout.

Administration

Your project must use play's default secure module.

Make sure your Secure.check implementation will check for profile 'cms' in order to give some users cms editing permissions.

In your site's layout include these lines among the header:

#{secure.check 'cms'}
  #{include 'WebAdmin/pageEditor.html'/}
  <a class="btn btn-primary" href="@{WebAdmin.status()}">&{'web.admin'}</a>
#{/secure.check}

play-web's People

Contributors

angryziber avatar asolntsev avatar cbmarek avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.