Get a variable System in template .ftl

Hi everyone,

I am beginner with keycloak and am trying to get my variable system in the template.ftl file.
I added my variable system under windows as “MY_VARIABLE_SYSTEM” then ${env.MY_VARIABLE_SYSTEM} in template.ftl but it doesn’t work.
Can someone helps please?

Jean

Hi,

I’ve taken a look and the solution is as follows.
It seems you can’t access it directly in the template file itself.

In your theme.properties file you set the variable like
testExternalVar=${env.DB_VENDOR}

And in your template you use it like
${properties.testExternalVar}

I’ve added an example on https://github.com/zonaut/keycloak-extensions/tree/master/theme-minimal

3 Likes