Add project description to login page

Our self-hosted instance does not have self sign-up enabled. We are doing invite-only from admin and moderators. So any newcomer who does not have an invitation will land on a very “dry” page where they only see the Log In buttom and a default text (see screenshot). I would like to add a custom text on that page, nothing fancy, pure text for now, that will tell them what the project is about and whom to contact to get invite links. Is there a way to do that without much codes?

1 Like

You can utilize a plugin outlet to do this, you’d have to add some code to your site’s theme (admin > customize > themes > edit html/css) in the </head> section.

Here’s an example:

<script type="text/x-handlebars" data-template-name="/connectors/below-static/custom-login">
    <div class="custom-login-content">
       Your custom content goes here
    </div>
</script>

You’d then need to add some CSS (in the CSS tab next to </head>):

.custom-login-content {
    display: none;
}
.static-login {
  .custom-login-content {   
    display: block;
  }
}

This would put the text “You custom content goes here” here:

Screen Shot 2021-05-17 at 6.31.26 PM

9 Likes

That looks like a great solution! I’m just confused by what you mean by using a “plugin outlet”. Is there an actual plugin (which one?) I need to install first in order to do that customization?

4 Likes

Have a look at Developer’s guide to Discourse Themes. “plugin outlet” is a term of art. You don’t need a plugin to use it!

4 Likes

So I tried exactly that, hit the Save button. Went back to the site. There were no effect. I’m still seeing the default message.

3 Likes

I also tried editing these text fields:


But there were no effect on the Login page after saving the changes.

2 Likes

I just double checked and it wasn’t working, my mistake! I’ve updated my post above with an updated way to do it (that worked when I tested it).

6 Likes

It’s working! Much appreciated! The new text is added to the default, I was hoping it would replace it.

Also, if I want to display an image also in there, after or before my text, can I add further HTML code for that? what’s the easiest way to link one that would be stored in the docker container and where should I upload this image?

1 Like

So the new text is displayed after the default one. Any idea how to get rid of the latter?

1 Like

I believe you were editing the wrong one; in customize > text try to search for login_required.welcome_message_invite_only and edit that

3 Likes

Perfect! In fact that offers another option to modify the text.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.