LifeRay: When I build the war, my changes are removed

▼魔方 西西 提交于 2019-12-13 04:43:37

问题


I have setted up a liferay environament with eclipse and tomcat (first time I use any of them),

And I want to make some changes, for example, I add a <p> in the end of the navigation.vm:

But when I build the war, like this:

My change dissapears:

Any idea what I'm doing wrong?


回答1:


probably you're trying to edit the portal-normal.vm under

yourTheme/docroot/templates

but you can't. You have to create a new folder called _diffs under

yourTheme/docroot

in which you copy the folders structure of docroot, in this case you need only of template folder in which create a new file called portal-normal.vm.

And that will be the file you can edit!

for more details : https://www.liferay.com/it/documentation/liferay-portal/6.1/development/-/ai/creating-liferay-them-7

PS
Obviously you can copy the original content of portal-normal.vm

PPS
I really don't know why liferay does not create the _diffs folder as default of a theme project!

EDIT

I forgot to say that you have to copy the folder structure of docroot in _diffs




回答2:


In other words... if you don't want to see the content removed of the files *.vm (for example portal_normal.vm) you must first create a folder templates in the folder docroot/_diffs with the files *.vm.

When we generate the WAR file, will automatically take the changes and you will see them in the folder docroot/templates/*.vm and also in the WAR file.



来源:https://stackoverflow.com/questions/26037640/liferay-when-i-build-the-war-my-changes-are-removed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!