我想创建自定义 liferay 主题。在教程中说我要将目录从经典主题复制到_diff
我的主题文件夹。但我找不到经典主题文件夹。
3 回答
如果您已经使用 maven(如果您使用的是 maven)创建了 liferay-theme 项目,如下所示
mvn archetype:generate \
-DarchetypeArtifactId=liferay-theme-archetype \
-DarchetypeGroupId=com.liferay.maven.archetypes \
-DarchetypeVersion=6.1.0 \
-DartifactId=sample-theme \
-DgroupId=com.liferay.sample \
-Dversion=1.0-SNAPSHOT
然后只需查看 ./target/liferay-theme/work 文件夹。啊,就是这样。
无需实际编译它——Liferay 会在maven 插件theme-merge
阶段合并您的主题应该应用于经典主题的任何更改。liferay
它的工作原理很像 maven 叠加层,因此您可以忽略不打算更改的经典主题中的每个文件。
There is no classic theme folder. Simply make copies of the /css /images /js and /templates folder from /docroot and put them into the /_diffs folder.
Then you start making all your edits in the /_diffs folder copies. When the project is built via ANT, it overwrites the files in the root /docroot folders you copied.
If you want to embed images in a theme, put them in /docroot/_diffs/images/custom and use this code.
<img src="$themeDisplay.getPathThemeImages()/custom/logo.png" id="splash_logo" />
您可以在 liferay 中创建新主题,而无需修改默认的 liferay 主题。
使用以下链接创建主题。
https://help.liferay.com/hc/en-us/articles/360035353731-Introduction-to-Creating-a-Theme
这对于搜索自定义 liferay 主题的人很有用。
并转到管理员帐户右上角的设置图标,然后单击look-and-feel
-> 定义此页面的特定外观。-> 更改当前主题