简体   繁体   English

创建带有Spring MVC模板模块的Magnolia CMS

[英]Magnolia CMS with Spring MVC Template module creation

I created the Magnolia + Spring MVC + maven projects followed the manual . 我按照手册创建了Magnolia + Spring MVC + maven项目。 I added MainTemplate.java , TextComponent.java , contentArea.jsp and mainTemplate.ftl to the acme-module skeleton project. 我将MainTemplate.javaTextComponent.javacontentArea.jspmainTemplate.ftl到了acme-module骨架项目中。 Projects archive downloadable here . 项目档案可在此处下载。 When I runned the jetty container with mvn jetty:run-war in the web project, I noticed on the console: 2016-05-26 11:19:18,850 INFO .magnolia.module.blossom.template.TemplateExporter: Registered templates [myModule:components/text,myModule:components/main] 当我在Web项目中使用mvn jetty:run-war码头容器时,在控制台上注意到: 2016-05-26 11:19:18,850 INFO .magnolia.module.blossom.template.TemplateExporter: Registered templates [myModule:components/text,myModule:components/main]

But in the admin UI there is no any available templates in the combo, when I want to create a new Page. 但是,在管理界面中,当我要创建新页面时,组合中没有任何可用的模板。

Change myModule:components/main in MainTemplate to myModule:pages/main . myModule:components/main更改为myModule:pages/main

That's how Magnolia knows if a template is a page or a component. 这就是Magnolia知道模板是页面还是组件的方式。 Right now you have two component templates and no page template. 现在,您有两个组件模板,而没有页面模板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM