How can I modify the Admin Theme?
Written By
Daniel Mijarra
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- Sometimes we need to modify some aspects of the admin-theme, for example, to change the look and feel of web content editions.
Resolution
- The admin-theme can not be modified directly, we need to create a new theme based on the admin-theme and then modify this new custom admin-theme.
- Steps to create the
custom-admin-theme
:
- Create a new theme following the steps described in this article Creating Themes.
custom-admin-theme
will be used as its name.
- Copy the following folders from
LIFERAY_SRC_7_x/modules/apps/frontend-theme/frontend-theme-admin/src
to the /src
folder of custom-admin-theme
:
CSS
Templates
Images
- Edit
/src/WEB-INF/liferay-look-and-feel.xml
and replace the xml tags included between the tag <theme>...</theme>
by <control-panel-theme>true</control-panel-theme>
, like this:
<?xml version="1.0"?>
<!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel 7.1.0//EN" "http://www.liferay.com/dtd/liferay-look-and-feel_7_1_0.dtd">
<look-and-feel>
<compatibility>
<version>
7.1.0+
</version>
</compatibility>
<theme id="custom-admin-theme" name="custom-admin-theme">
<control-panel-theme>
true
</control-panel-theme>
</theme>
</look-and-feel>
- Make the modifications that you need. For example, to modify some css, edit
/src/css/_custom.scss
and add or modify the css rules you need.
- Compile the
custom-admin-theme
and deploy it into Liferay.
- To apply the new theme, please access Control Panel > Configuration > Instance Settings > Miscellaneous > Look and Feel > Default Control Panel Theme and select
custom-admin-theme
.
Did this article resolve your issue ?