开发者

scalate/scaml layout not applied

I've followed the user manual to apply a default template, e.g. in the projects src/main/webapp/WEB-INF/scalate/layouts/default.scaml I have a template that's supposed to get applied to all scaml files, but when I hit my test page (in src/main/webapp/WEB-INF/views/x/view.scaml) it only renders the content in that one page. Even if I put an explicit layout attribute at the top it still doesn't render, i.e.开发者_开发问答

- attributes ("layout") = "/WEB-INF/scalate/layouts/default.scaml"

Any idea on what I could be doing wrong?


Digging into the scalate source code (1.4.1) it appears that the viewName is expected to be prefixed with "layout:" if layouts should be applied, see https://github.com/scalate/scalate/blob/master/scalate-spring-mvc/src/main/scala/org/fusesource/scalate/spring/view/ScalateViewResolver.scala.

This seems like a very odd decision, since the docs indicate that layouts can be disabled on a per view basis by doing:

- attributes("layout") = ""

Given this I'm not sure why layouts are disabled by default and each view must explicitly ask for the layout feature to be enabled.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜