# إخفاء بعض حقول المستخدم المخصصة من صفحة الحساب الجديد

**URL:** https://meta.discourse.org/t/hide-some-user-custom-fields-from-new-account-page/108986
**Category:** Support
**Created:** [12 فبراير 2019، 9:30م UTC](https://meta.discourse.org/t/hide-some-user-custom-fields-from-new-account-page/108986 "2019-02-12T21:30:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12 فبراير 2019، 9:30م UTC](https://meta.discourse.org/t/hide-some-user-custom-fields-from-new-account-page/108986/1 "2019-02-12T21:30:56Z")

</div>

I have a bunch of user custom fields from an import. I would like only one of them to be included on the login page. When I look at the CSS, the different fields are tagged with only an `ember-xxx` tag. Is it safe to use those tags to target individual fields or are they likely to change if . . . something … changes?

Edit: Or if there were a way to make a user custom field as “hidden from user” that would be another solution to the problem.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [12 فبراير 2019، 9:35م UTC](https://meta.discourse.org/t/hide-some-user-custom-fields-from-new-account-page/108986/2 "2019-02-12T21:35:33Z")

</div>

Pretty sure that if you define a user field in admin and tick nothing, it will not show up to end users. We implemented that a few months ago.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12 فبراير 2019، 9:36م UTC](https://meta.discourse.org/t/hide-some-user-custom-fields-from-new-account-page/108986/3 "2019-02-12T21:36:46Z")

</div>

That’s what I thought, but all the fields are un-checked and they all show up on the new user page.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [12 فبراير 2019، 9:38م UTC](https://meta.discourse.org/t/hide-some-user-custom-fields-from-new-account-page/108986/4 "2019-02-12T21:38:12Z")

</div>

To you or the end user, pretty sure @david tested this.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [12 فبراير 2019، 9:45م UTC](https://meta.discourse.org/t/hide-some-user-custom-fields-from-new-account-page/108986/5 "2019-02-12T21:45:03Z")

</div>

We serialize all user fields for staff members, and for the user themselves

> <https://github.com/discourse/discourse/blob/main/lib/guardian/user_guardian.rb#L105-L109>

I think @pfaffman is talking about the signup modal, where we always show all fields.

> [@pfaffman](#):
>
> `ember-xxx` tag. Is it safe to use those tags

Short answer: no 😉

The slightly safer method, if this is for a specific site, would be to use the nth-of-type selector

```plaintext
.user-fields div{
  display: none;

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

```

I think a PR to add `data-field-name=blah` to the div elements would be welcome.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12 فبراير 2019، 10:53م UTC](https://meta.discourse.org/t/hide-some-user-custom-fields-from-new-account-page/108986/6 "2019-02-12T22:53:03Z")

</div>

Thanks, @david! That wasn’t quite right, but it was enough to get me there. Here’s what I did:

```javascript
.create-account .user-fields .user-field {
    display: none;
    
    &:nth-of-type(10){
        display: block;
    }
}

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [14 مارس 2019، 10:53م UTC](https://meta.discourse.org/t/hide-some-user-custom-fields-from-new-account-page/108986/7 "2019-03-14T22:53:05Z")

</div>

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