留言板

Layout template deployment

thumbnail
Dave Weitzel,修改在6 年前。

Layout template deployment

Regular Member 帖子: 208 加入日期: 09-11-18 最近的帖子
I cannot get my custom layout template(s) to deploy.
I have multiple since the generator (yo liferay-theme:template) asks do you want to use this as your Id? and I enter y it creates y.tpl, YES it creates YES.tpl so I guess you re-enter your name here. emoticon
Anyway it creates the templates in src/layouttpl/custom/name-template just fine. IDE even picks it up to offer editor if required.
I run gulp deploy on the theme though deploys the theme but the templates don't appear in the control panel components list or when adding a new page to a site.
The theme appears in the control panel and the theme war file has the templates in layouttpl/custom folder.
I don't see any reference in any properties or other files to the layout templates os os this bug? can I manually say put them in <tomcat>/webapps/ROOT/layouttpl/custom
thumbnail
Wouter Vernaillen,修改在6 年前。

RE: Layout template deployment

Junior Member 帖子: 80 加入日期: 09-6-6 最近的帖子
Do you have a file "liferay-layout-templates.xml" under the WEB-INF folder? On deployment of the theme, this file will be read to load any custom templates that you've added.

I don't think the generator creates that (which it should).

This is how the file should look like to load the "name-template" template that you created:

<!--?xml version="1.0"?-->


<layout-templates>
	<custom>
		<layout-template id="name-template" name="Name Template">
			<template-path>/layouttpl/custom/name-template.tpl</template-path>
			<thumbnail-path>/layouttpl/custom/name-template.png</thumbnail-path>
		</layout-template>
	</custom>
</layout-templates>