Updated doc for themes

This commit is contained in:
Stian Thorgersen 2014-05-27 13:08:00 +01:00
parent 1007d19860
commit c196849574

View file

@ -16,11 +16,30 @@
</para> </para>
</section> </section>
<section>
<title>Default themes</title>
<para>
Keycloak comes bundled with default themes in <literal>standalone/configuration/themes</literal>. It is
not recommended to edit these themes directly. Instead you should create a new theme to extend a default
theme. A good reference is to copy the keycloak themes as these extend the base theme to add styling.
</para>
</section>
<section> <section>
<title>Creating a theme</title> <title>Creating a theme</title>
<para> <para>
There are two types of themes in Keycloak, <literal>login</literal> and <literal>account</literal>. Login themes are used to customize the There are several types of themes in Keycloak:
login forms, while account themes are used to customize account management. A theme consists of: <itemizedlist>
<listitem>Account - Account management</listitem>
<listitem>Admin - Admin console</listitem>
<listitem>Common - Shared resources for themes</listitem>
<listitem>Email - Emails</listitem>
<listitem>Login - Login forms</listitem>
</itemizedlist>
</para>
<para>
A theme consists of:
<itemizedlist> <itemizedlist>
<listitem><para><ulink url="http://freemarker.org">FreeMarker</ulink> templates</para></listitem> <listitem><para><ulink url="http://freemarker.org">FreeMarker</ulink> templates</para></listitem>
<listitem><para>Stylesheets</para></listitem> <listitem><para>Stylesheets</para></listitem>
@ -37,9 +56,9 @@
templates. templates.
</para> </para>
<para> <para>
To create a new theme, create a folder in <literal>.../standalone/configuration/themes/login</literal> or To create a new theme, create a folder in <literal>.../standalone/configuration/themes/&lt; theme type&gt;</literal>.
<literal>.../standalone/configuration/themes/account</literal>. The name of the folder is the name of the theme. The name of the folder is the name of the theme. Then create a file <literal>theme.properties</literal> inside the theme folder.
Then create a file <literal>theme.properties</literal> inside the theme folder. The contents of the file should be: The contents of the file should be:
</para> </para>
<programlisting>parent=base</programlisting> <programlisting>parent=base</programlisting>
<para> <para>
@ -104,24 +123,6 @@
Check out the Freemarker website on how to form a template file. Check out the Freemarker website on how to form a template file.
</para> </para>
</section> </section>
<section>
<title>Full Example Templates</title>
<para>
Keycloak comes bundled with some default themes which you cannot view or modify. The distribution
also contains full example templates which you can edit directly if you're running the Keycloak appliance
distro, or which you can install, if you're using the WAR distro. The name of these full example themes
is <literal>template</literal> and they contain a complex example for generating all pages related
to login, error displaying, oauth grant pages, and user account management.
</para>
<para>
For the Keycloak Appliance Distro, these theme files are in the directories
<literal>${appliance-distro}/keycloak/standalone/configuration/themes/login/template</literal>
and <literal>${appliance-distro}/keycloak/standalone/configuration/themes/account/template</literal>.
For the WAR distro, there is a zip file in the examples directory called <literal>keycloak-example-themes-dist.zip</literal>
which you will need to unzip in the <literal>standalone/configuration</literal> or <literal>domain/configuration</literal>
directory if the JBoss or Wildfly instance you have deployed Keycloak server to.
</para>
</section>
</section> </section>
<section> <section>