【问题标题】:How to create custom theme in Liferay with default theme as parent?如何在 Liferay 中以默认主题为父主题创建自定义主题?
【发布时间】:2015-10-07 23:41:26
【问题描述】:

我想弄清楚有关创建和更改 Liferay 主题的一些事情。现在我想对默认主题进行一些更改。我从 maven archetype 为 liferay 主题创建了项目。将默认主题设置为父主题,将所有文件复制到我的 /webapp 文件夹。这是我的 pom.xml

<?xml version="1.0"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
    <artifactId>theme</artifactId>
    <groupId>by.velcom</groupId>
    <version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sample-theme</artifactId>
<packaging>war</packaging>
<name>sample-theme Theme</name>
<build>
    <plugins>
        <plugin>
            <groupId>com.liferay.maven.plugins</groupId>
            <artifactId>liferay-maven-plugin</artifactId>
            <version>${liferay.maven.plugin.version}</version>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>theme-merge</goal>
                        <goal>build-css</goal>
                        <goal>build-thumbnail</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
                <appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir>
                <appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir>
                <appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir>
                <liferayVersion>${liferay.version}</liferayVersion>
                <parentTheme>${liferay.theme.parent}</parentTheme>
                <pluginType>theme</pluginType>
                <themeType>${liferay.theme.type}</themeType>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>portal-service</artifactId>
        <version>${liferay.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>util-bridges</artifactId>
        <version>${liferay.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>util-taglib</artifactId>
        <version>${liferay.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>util-java</artifactId>
        <version>${liferay.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.portlet</groupId>
        <artifactId>portlet-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
<properties>
    <liferay.theme.parent>_unstyled</liferay.theme.parent>
    <liferay.theme.type>vm</liferay.theme.type>
</properties>

然后我更改了样式和模板,部署了 sample-theme.war。 新主题已添加到配置-> 显示设置(示例主题)。但是当我选择它并申请时,我没有看到我所做的任何更改。谁能告诉我我做错了什么?

【问题讨论】:

标签: java liferay liferay-6 portlet liferay-theme


【解决方案1】:

如果默认你指的是经典,那么你必须改变

这个

<liferay.theme.parent>_unstyled</liferay.theme.parent>

为此

<liferay.theme.parent>_classic</liferay.theme.parent>

并运行 maven 任务以应用它,记住您只需要复制要修改的文件。

【讨论】:

    猜你喜欢
    • 2020-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-15
    • 2018-06-20
    • 2019-09-14
    相关资源
    最近更新 更多