הוסף תיאור פרויקט לדף הכניסה

סיכום מבוסס בינה מלאכותית

In a support discussion titled ‘Add project description to login page,’ Wall-E seeks to customize the login page of their invite-only Discourse instance to display a project description and contact info for invites, since the default page appears too sparse. awesomerobot suggests using a plugin outlet via theme customization—adding Handlebars template code in the theme’s </head> section and corresponding CSS to display custom content on the static login page. Wall-E initially misunderstands “plugin outlet” as requiring a separate plugin, but pfaffman clarifies it’s a built-in theme feature. After an initial misconfiguration, awesomerobot updates the code, which then works for Wall-E. Wall-E asks how to replace rather than append the default text, and awesomerobot directs them to edit the login_required.welcome_message_invite_only text setting under Customize > Text, which Wall-E confirms successfully provides an alternative way to modify the message. The discussion concludes with Wall-E also inquiring about embedding images, though no solution is provided in the thread.

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?

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:

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?

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!

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.

I also tried editing these text fields:


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

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).

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?

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

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

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