Fórum

Override layout in custom theme

David Knol, modificado 7 Anos atrás.

Override layout in custom theme

Junior Member Postagens: 29 Data de Entrada: 19/06/15 Postagens Recentes
Hi,
I have created my own Liferay theme. Now I want to override some of the generic layouts (e.g. '2-columns-ii'). I've tried to follow official tutorial and use theme generator but after doing all steps a new layout is not visible in Liferay. So how can I override existing layout in my theme? Thanks in advance!
David Knol, modificado 7 Anos atrás.

RE: Override layout in custom theme

Junior Member Postagens: 29 Data de Entrada: 19/06/15 Postagens Recentes
Ok, I've solved the problem. The case was to add fallowing code to 'liferay-look-and-feel.xml':

		<layout-templates>
			<custom>
				<layout-template id="2_columns_ii">
					<template-path>/layouttpl/custom/2_columns_ii.tpl</template-path>
					<thumbnail-path>/layouttpl/custom/2_columns_ii.png</thumbnail-path>
				</layout-template>
			</custom>
		</layout-templates>
thumbnail
Alex Pierce, modificado 7 Anos atrás.

RE: Override layout in custom theme

New Member Postagens: 12 Data de Entrada: 30/11/16 Postagens Recentes
Hi,
I am creating Liferay 7 theme with custom layout using yo following these guide:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/creating-layout-templates-with-the-themes-generator-0

yo liferay-theme
yo liferay-theme:layout


Then I am adding the code as stated above.
<look-and-feel>
    <compatibility>
        <version>7.0.0+</version>
    </compatibility>
    <theme id="library-theme" name="Library Theme">
        <template-extension>ftl</template-extension>
        
        <portlet-decorator id="barebone" name="Barebone">
            <portlet-decorator-css-class>portlet-barebone</portlet-decorator-css-class>
        </portlet-decorator>
        <portlet-decorator id="borderless" name="Borderless">
            <portlet-decorator-css-class>portlet-borderless</portlet-decorator-css-class>
        </portlet-decorator>
        <portlet-decorator id="decorate" name="Decorate">
            <default-portlet-decorator>true</default-portlet-decorator>
            <portlet-decorator-css-class>portlet-decorate</portlet-decorator-css-class>
        </portlet-decorator>
        
        <layout-templates>
            <custom>
                <layout-template id="wide-search" name="Wide-Search Layout">
                    <template-path>/layouttpl/custom/wide-search-layouttpl/wide_search.tpl</template-path>
                    <thumbnail-path>/layouttpl/custom/wide-search-layouttpl/wide_search.png</thumbnail-path>
                </layout-template>
            </custom>
        </layout-templates>
    </theme>
</look-and-feel>


Theme has deployed successfully, but I still not see new layout in control panel. What should I do?

09:23:23,169 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][BaseAutoDeployListener:50] Themes for /home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/tomcat-8.0.32/temp/20161208092321635KZIOTFIW/library-theme.war copied successfully
09:23:24,710 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][BundleStartStopLogger:35] STARTED library-theme_1.0.0 [491]
09:23:25,386 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][HotDeployImpl:226] Deploying library-theme from queue
09:23:25,386 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][PluginPackageUtil:1006] Reading plugin package for library-theme
08-Dec-2016 09:23:25.399 INFO [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
09:23:25,422 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][ThemeHotDeployListener:94] Registering themes for library-theme
09:23:26,097 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][ThemeHotDeployListener:109] 1 theme for library-theme is available for use


UPD: Then I create layout separately from theme, new layout is visible on new page creation, but not visible, when I edit the page.
thumbnail
Zsombor Nagy, modificado 6 Anos atrás.

RE: Override layout in custom theme

New Member Postagens: 22 Data de Entrada: 22/03/17 Postagens Recentes
Alex Pierce:
Hi,
I am creating Liferay 7 theme with custom layout using yo following these guide:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/creating-layout-templates-with-the-themes-generator-0

yo liferay-theme
yo liferay-theme:layout


Then I am adding the code as stated above.
<look-and-feel>
    <compatibility>
        <version>7.0.0+</version>
    </compatibility>
    <theme id="library-theme" name="Library Theme">
        <template-extension>ftl</template-extension>
        
        <portlet-decorator id="barebone" name="Barebone">
            <portlet-decorator-css-class>portlet-barebone</portlet-decorator-css-class>
        </portlet-decorator>
        <portlet-decorator id="borderless" name="Borderless">
            <portlet-decorator-css-class>portlet-borderless</portlet-decorator-css-class>
        </portlet-decorator>
        <portlet-decorator id="decorate" name="Decorate">
            <default-portlet-decorator>true</default-portlet-decorator>
            <portlet-decorator-css-class>portlet-decorate</portlet-decorator-css-class>
        </portlet-decorator>
        
        <layout-templates>
            <custom>
                <layout-template id="wide-search" name="Wide-Search Layout">
                    <template-path>/layouttpl/custom/wide-search-layouttpl/wide_search.tpl</template-path>
                    <thumbnail-path>/layouttpl/custom/wide-search-layouttpl/wide_search.png</thumbnail-path>
                </layout-template>
            </custom>
        </layout-templates>
    </theme>
</look-and-feel>


Theme has deployed successfully, but I still not see new layout in control panel. What should I do?

09:23:23,169 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][BaseAutoDeployListener:50] Themes for /home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/tomcat-8.0.32/temp/20161208092321635KZIOTFIW/library-theme.war copied successfully
09:23:24,710 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][BundleStartStopLogger:35] STARTED library-theme_1.0.0 [491]
09:23:25,386 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][HotDeployImpl:226] Deploying library-theme from queue
09:23:25,386 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][PluginPackageUtil:1006] Reading plugin package for library-theme
08-Dec-2016 09:23:25.399 INFO [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
09:23:25,422 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][ThemeHotDeployListener:94] Registering themes for library-theme
09:23:26,097 INFO  [fileinstall-/home/ninomt/Sources/Development/Liferay/7.0_ga3_tomcat/liferay-ce-portal-7.0-ga3/osgi/war][ThemeHotDeployListener:109] 1 theme for library-theme is available for use


UPD: Then I create layout separately from theme, new layout is visible on new page creation, but not visible, when I edit the page.


Hi!

I'm having the same issue. Did you find any answer to the original problem, meaning that I want to keep my Layout template with the theme, and I'd like to be able to access it...

If you found any solution, please share it emoticon