Japid layout with different folder for Play 2.0

75 views Asked by At

I have encounter japid layout problem with layout and html problem. For japid, if I have layout with loginlayout.html in Application folder. and my login.html in the Application folder too. Therefore my code will like below:

@extends loginLayout("Login")
<h1>Testing</h1>

something like this. These will not have any problem if both of them are in the same folder. If I put the loginlayout.html in the _layout folder, and my login.html is in Applicaiton folder. How do I import the loginLayout into Application folder.

Thanks ... I have google lots but most of the solution is support for Play version 1, its doesn't help on Play version 2.

1

There are 1 answers

0
Bing On

Not sure if you have figure it out.

_layouts in Japid for Play 2 has been deprecated. You can import any directory to any templates by doing something like the following in the Global.java

import cn.bran.japid.template.JapidRenderer;

public class Global extends JapidRenderer {
    @Override
    public void onStartJapid() {
        addImport("japidviews._layouts.*");
        addImport("japidviews._tags.*");
    }
}