Site setting to hide custom user fields from signup page

I thought that I had seen such a feature request recently, but I can’t find it.

If you have a bunch of user custom fields, the login modal gets ugly. If there are 10 optional fields and 2 required fields, one has to scroll a bunch to find the one(s) that are required. This is a drag.

It’s possible to hide those fields with CSS like:

.create-account .user-fields .user-field {
    display: none;

    &:nth-of-type(4){
        display: block;
    }

}

It’s something of a bother, as you have to guess what nth-of-type to use by trial and error, but what I might suggest is a :bug: is that the CSS that worked to make that modal look the right way changes every now and again. It looks like it got changed in the recent beta6. It makes my client sad, as the required fields are not visible, so people couldn’t sign up. He found out only because someone emailed to complain.

Problem solved!

CSS Got added to those fields, so this isn’t a problem any more!

10 „Gefällt mir“

I don’t think it would be hard to add a class or data attribute that includes the custom field’s name, which would make it much less fragile to target with CSS. I can probably get to that within the next couple of days.

7 „Gefällt mir“

Took a quick look and it’s nearly identical to another PR I opened recently to add a class to tag groups. So here’s a PR for this… we might want to add a helper to sanitize class names before merging these?

9 „Gefällt mir“

I just realized that I never followed up after this was merged. Now on the signup page all user fields have a class in the form of user-field-name. So if you had a field with the name “terms and conditions” it would have the class user-field-terms-and-conditions.

You can also take a shortcut and hide all custom user fields at signup with

.d-modal.create-account div[class*="user-field-"] {
    display: none;
}
7 „Gefällt mir“

Thanks! I managed to get this done a week or two ago. You might edit that list to also include the css to un-hide a field or two after hiding the rest.

2 „Gefällt mir“

Here is a closed thread about solving this, which includes a css solution:

Right now for custom user fields, the options are:

Editable after signup?
Required at signup?
Show on public profile?
Show on user card?

I think another option would be quite useful:

Show on signup form?
or
Hide on signup form?

By default, without custom CSS modification, all custom fields (optional or not) will be displayed on the registration form. This somewhat limits the amount of custom fields that can be implemented as having too many will make the registration form overloaded and potentially intimidating to new users.

11 „Gefällt mir“

Sometimes it is nice to have a bunch of custom user fields to ask for information that you don’t want to bother people with on signup. For example, you might want to have the ability for someone to provide their address, zip code, or hair color, but on signup ask them only for their name and email address.

This is possible now by using a theme component to hide all custom fields and then un-hide the ones you want. It would be nice if there were a checkbox in the custom user field settings.

10 „Gefällt mir“

This would be great.

It would also be helpful to be able to differentiate sign-ups and invitees, especially if a field is mandatory for both or just for signups.

For example, we ask people to provide their “Reason for Joining” to help us decide their suitability and group. This is redundant when people arrive via an invite link, but it can’t be hidden if mandatory or it breaks the signup for them.

3 „Gefällt mir“

Hallo,

Es gibt einige Benutzerfelder auf meiner Website, die bei der Registrierung nicht unbedingt erforderlich sind, z. B. soziale Medien.

Ich denke, wir könnten von einer Option „Nicht bei der Registrierung anzeigen“ profitieren, die sie während der Registrierung ausblendet und nur beim Bearbeiten Ihres Benutzerprofils sichtbar macht.

6 „Gefällt mir“

Sie können dies bereits über CSS erreichen:

Aber ja, es wäre sehr schön, dies als explizite Option zu haben! Es wurde jetzt schon ein paar Mal angefragt.

Ich habe alle #feature-Themen dazu in diesem Thema zusammengefasst.

4 „Gefällt mir“

Es hat auch in diesem Thema etwas Anklang gefunden:

11 „Gefällt mir“

Hat sich am Anmelde-Modal etwas geändert, das dazu führen könnte, dass dieser CSS-Code nicht mehr funktioniert?

Ich kann keine benutzerdefinierten Felder auf der Anmeldeseite ausblenden, weder mit dem Code aus dem ersten Beitrag von @pfaffman noch mit dem Code von @awesomerobot:

Ich habe den CSS-Code unter Themes > Common > CSS angewendet.

2 „Gefällt mir“

Es scheint, dass woanders in Discourse spezifischeres CSS hinzugefügt wurde, das display:none überschreibt…

.d-modal.create-account .user-field {
  display: flex;
}

Ich werde mir :point_up: genauer ansehen, ob wir so spezifisch sein müssen, aber in der Zwischenzeit sollte dieses :point_down: Update funktionieren:

.d-modal.create-account div[class*="user-field-"] {
  display: none;
}
2 „Gefällt mir“

Bestätigt, das hat perfekt funktioniert, um sie alle auszublenden!

Vielen Dank Kris @awesomerobot :smiley:

1 „Gefällt mir“

Eine Einstellung zum Ausblenden von Benutzerfeldern aus dem Registrierungsformular wurde hinzugefügt:

3 „Gefällt mir“

Dieses Thema wurde 3 Tage nach der letzten Antwort automatisch geschlossen. Neue Antworten sind nicht mehr möglich.