How to use theme.properties
See original GitHub issueHello! Love the project!
I’m new to Keycloak and Keycloakify, so apologies if this is a simple question.
I’m working on migrating an existing Keycloak theme to use Keycloakify. The existing theme is written using FTL.
The existing theme has variables in the FTL files like so;
<a name="Home" href="${primaryUrl}" title="${nameOfTitle}" data-ga-tracking-id="headerLogo">
My understanding is that these variables come from the theme.properties
file.
How can I access these variables on the React side?
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
What is Website Theming? How to Use CSS Custom ...
In this article, I'm going to show you how to theme your website so users can customize certain elements to their tastes.
Read more >Theme properties - Atlassian Developer
Theme properties · Add a look and feel property · Header properties · Heading properties · Links properties · Menus properties · Content...
Read more >Theme Properties - Indigo Rose Software
Theme Properties. Style. Colors. Use Custom Colors. Customize the colors used in the current project theme. This includes properties such as its text...
Read more >Theme Properties - Gooddata Growth
Themes use special JSON structures with CSS properties. This article describes individual properties and gives examples. Complete JSON structure. This is an ...
Read more >Styles and Themes - Android Developers
Styles and themes on Android allow you to separate the details of your app design from the UI structure and behavior, similar to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok sorry I’ll try explain better.
I have a theme called
myUserTheme
. Inside there is a directory calledcommon
, and in there, a file calledtheme.properties
. The file has many key/value pairs.Here is an example;
Inside
common
there is a directory calledproperties
, and inside here, a file calledAWL_properties.ftl
. There is a line at the top like this…So I guess this creates a global value called
nameOfTitle
(Accessible to any page or component) with the value (in this case) ofAmbrose Wilson
.Back in the
theme/common/components
directory, (file calledheader.ftl
) we come across this code;Nothing fancy here, simple header.
The global variable we defined earlier is being used in this template.
I guess my question is, how can I access these global variables from my React app/React components?
Thanks
Ok, thanks for the detailed explanation,
I will try to guide you in porting you theme to Keycloakify.
The values in
theme.properties
correspond tokcProps
in Keycloakify.You are in a situation where you want to re-write your ftl code into React components.
You will then pass props to those components, that will correspond to the keys value you had in
theme.properties
.You will for example create a
<Header>
component that take a propawl_nameOfTitle
and you will invoke it like this:<Header awl_nameOfTitle="Ambrose Wilson" />
.Converting
.ftl
files into React is not rocket science.Check for example how I converted
login.ftl
intoLogin.tsx
.To get you started you can read this section of the readme, I just updated the instructions.
Best regards.