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.

5 Likes

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.

6 Likes

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?

8 Likes

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

.create-account div[class*="user-field-"] {
    display: none;
}
4 Likes

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.

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