-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Allow users to customize the footer of a login theme #31391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to customize the footer of a login theme #31391
Conversation
7c83c5e to
d9796c1
Compare
|
An example custom login theme based on theme.properties: resources/css/custom-login.css #kc-login-footer-links {
text-align: center;
}
#kc-login-footer-links li{
display:inline-block;
}
<#macro content>
<!-- hello from footer.ftl -->
<div>
<#-- footer at the end of the login box -->
<hr id="kc-login-footer-divider">
<ul id="kc-login-footer-links">
<li><a href="https://apps.training.test/apps/site#home">Home</a></li>
<li><a href="https://apps.training.test/apps/site#about">About</a></li>
<li><a href="https://apps.training.test/apps/site#services">Services</a></li>
<li><a href="https://apps.training.test/apps/site#contact">Contact</a></li>
</ul>
<div>
</#macro> |
51192b4 to
49ff69d
Compare
|
Great idea! |
|
@cturkalj I thought about that too. How about the following:
Both macros would be empty by default. Would that work for you? |
|
@thomasdarimont: |
|
I did a small example for the suggested extension: It contains a two footer templates:
If that's okay, then I'd update this PR. |
49ff69d to
3c33f53
Compare
|
I updated the PR based on the suggestions. I now use an empty Allthough I think the |
jonkoops
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Added note to release notes |
|
@thomasdarimont - there is a conflict with the release notes. Please rebase and resolve. |
b5a0e71 to
10eda87
Compare
|
@ahus1 Thanks for the review. I rebased the PR and resolved the conflict. I also added support for the custom footer(s) to the login.v2 theme which I learned will become the default login theme from now on. However, there are some issues with the login theme v2 which I mentioned on the maintainers mailing list. So I'd recommend to wait for feedback from the other maintainers before merging this PR. |
10eda87 to
aa3e8d2
Compare
|
I also tested this with the keycloak.v2 login theme. Theme minimal.v2/login, see: https://gist.github.com/thomasdarimont/5fe725319a5fc3c8242669deddd934a8 Custom theme based on Login V2 with empty Footer Custom theme based on Login V2 with Footer Custom theme based on Login V2 with Identity Providers and Footer |
|
@cturkalj I experimented a bit further with the footer customizations and I think it would be sufficient to only have one Can you think of something that would not be possible if we only had one footer.ftl ( the login-footer.ftl in the current examples)? If there are no issues then I adapt this PR and only keep the login-footer.ftl file. |
|
@thomasdarimont: Now that we have just one (login)-footer.ftl left, should it be renamed it back to footer.ftl? |
896a7b7 to
5c8f043
Compare
|
I revised the PR to only contain 1 additional template file ->
|
5c8f043 to
2bb4e0d
Compare
Previously, users had to copy the whole template.ftl file or resort to css/js hacks to add a custom footer. This PR adds new footer.ftl template to the base login theme to allow users to configure a footer for the login box, as well as the page footer. The new footer.ftl template contains a content macro that can be added at the bottom of the login page. Adjusted template.ftl in base/login and keycloak.v2 theme to render footer.ftl macro. Fixes keycloak#31390 Signed-off-by: Thomas Darimont <[email protected]>
2bb4e0d to
d9e086c
Compare
ahus1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes keycloak#31390 Signed-off-by: Thomas Darimont <[email protected]>
Previously, users had to copy the whole template.ftl file or resort to css/js hacks to add a custom footer.
This PR adds new footer templates to the
base/loginandkeycloak.v2/loginthemes to allow usersto configure a footer for the login box.
The new
footer.ftltemplate contains a content macro that can be added at the bottom of the "login box".Adjusted
template.ftlin base login theme to render the macro fromfooter.ftlThe new templates are empty by default to avoid conflicts with existing themes.
Fixes #31390