DEV Community

Wasim Shaikh
Wasim Shaikh

Posted on

1

Liferay theme custom setting

Update the Look and feel XML File

<#--
This file allows you to override and define new FreeMarker variables.
-->
<#assign
show_header = getterUtil.getBoolean(themeDisplay.getThemeSetting("show-header"))
/>
view raw init_custom.ftl hosted with ❤ by GitHub
<?xml version="1.0"?>
<!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel 7.3.0//EN" "http://www.liferay.com/dtd/liferay-look-and-feel_7_3_0.dtd">
<look-and-feel>
<compatibility>
<version>7.3.0+</version>
</compatibility>
<theme id="my-website" name="my-website">
<template-extension>ftl</template-extension>
<settings>
<setting configurable="true" key="show-header" type="checkbox" value="true" />
</settings>
<portlet-decorator id="barebone" name="Barebone">
<default-portlet-decorator>true</default-portlet-decorator>
<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">
<portlet-decorator-css-class>portlet-decorate</portlet-decorator-css-class>
</portlet-decorator>
</theme>
</look-and-feel>
<#if show_header && !is_signed_in>
<header class="header fixed-header">
<#else>
<header class="header">
</#if>

Add custom variable

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️