Introduce index.ftl into base account theme

Fixes: #26487

Signed-off-by: Hynek Mlnarik <hmlnarik@redhat.com>
This commit is contained in:
Hynek Mlnarik 2024-01-30 13:27:55 +01:00 committed by Hynek Mlnařík
parent 6f91e2c540
commit c866e8e6f9
3 changed files with 22 additions and 6 deletions

View file

@ -59,9 +59,8 @@ A theme consists of:
* Scripts * Scripts
* Theme properties * Theme properties
Unless you plan to replace every single page you should extend another theme. Most likely you will want to extend the {project_name} theme, but you could also Unless you plan to replace every single page you should extend another theme. Most likely you will want to extend some existing theme. Alternatively, if you intend to provide your own implementation of the admin or account console,
consider extending the base theme if you are significantly changing the look and feel of the pages. The base theme primarily consists of HTML templates and consider extending the `base` theme. The `base` theme consists of a message bundle and therefore such implementation needs to start from scratch, including implementation of the main `index.ftl` Freemarker template, but it can leverage existing translations from the message bundle.
message bundles, while the {project_name} theme primarily contains images and stylesheets.
When extending a theme you can override individual resources (templates, stylesheets, etc.). If you decide to override HTML templates bear in mind that you may When extending a theme you can override individual resources (templates, stylesheets, etc.). If you decide to override HTML templates bear in mind that you may
need to update your custom template when upgrading to a new release. need to update your custom template when upgrading to a new release.
@ -89,7 +88,7 @@ For example, to add the login type to the `mytheme` theme, create the directory
. For each type create a file `theme.properties` which allows setting some configuration for the theme. . For each type create a file `theme.properties` which allows setting some configuration for the theme.
+ +
For example, to configure the theme `themes/mytheme/login` to extend the base theme and import some common resources, create the file `themes/mytheme/login/theme.properties` with following contents: For example, to configure the theme `themes/mytheme/login` to extend the `base` theme and import some common resources, create the file `themes/mytheme/login/theme.properties` with following contents:
+ +
[source] [source]
---- ----
@ -342,12 +341,12 @@ kcLogoIdP-myProvider = fa fa-lock
---- ----
All icons are available on the official website of PatternFly4. All icons are available on the official website of PatternFly4.
Icons for social providers are already defined in base login theme properties (`themes/keycloak/login/theme.properties`), where you can inspire yourself. Icons for social providers are already defined in `base` login theme properties (`themes/keycloak/login/theme.properties`), where you can inspire yourself.
==== Creating a custom HTML template ==== Creating a custom HTML template
{project_name} uses https://freemarker.apache.org/[Apache Freemarker] templates to generate HTML. You can override individual templates in your own theme by {project_name} uses https://freemarker.apache.org/[Apache Freemarker] templates to generate HTML. You can override individual templates in your own theme by
creating `<THEME TYPE>/<TEMPLATE>.ftl`. For a list of templates used see `themes/base/<THEME TYPE>`. creating `<THEME TYPE>/<TEMPLATE>.ftl`. Admin and account console use a single template `index.ftl` for rendering the application. For a list of templates in other theme types used see `themes/base/<THEME TYPE>`.
.Procedure .Procedure

View file

@ -0,0 +1,14 @@
<!doctype html>
<html lang="${locale}">
<head>
<title>${msg("accountManagementTitle")}</title>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
</head>
<body>
<h1>${msg("accountManagementWelcomeMessage")}</h1>
<p>${msg("accountManagementBaseThemeCannotBeUsedDirectly")}</p>
</body>
</html>

View file

@ -27,6 +27,9 @@ applicationsHtmlTitle=Applications
linkedAccountsHtmlTitle=Linked accounts linkedAccountsHtmlTitle=Linked accounts
accountManagementWelcomeMessage=Welcome to Keycloak Account Management accountManagementWelcomeMessage=Welcome to Keycloak Account Management
accountManagementBaseThemeCannotBeUsedDirectly=The base account theme only contains translations for account console. \
To display account console, you either need to set the parent of your theme to another account theme, or supply your own index.ftl file. \
Please see the documentation for further information.
personalInfoIntroMessage=Manage your basic information personalInfoIntroMessage=Manage your basic information
accountSecurityTitle=Account Security accountSecurityTitle=Account Security
accountSecurityIntroMessage=Control your password and account access accountSecurityIntroMessage=Control your password and account access