Implemented Custom Field: not viewable anywhere / only for Admin

erich37

Well-known member
I do have created a few "user custom fields" which show to the user at the "Register Page".

So Admin can easily verify user based on these "custom fields" which he need to populate (required fields) during registration (sign up).


But there is one issue:
these "custom fields" should only show to Admin in order to be able to verify the user.

It would be great if there would be an "option" in order to not "display" these fields in "Preferences" or anywhere else.




custom_field_not_show.webp
 
Upvote 1
This suggestion has been implemented. Votes are no longer accepted.
@Chris D: I'm not sure if you're referring to the "viewable on profile pages" option, but that wouldn't cover the case of users editing them. "Editable only once" would though (if you made the field required, it would be filled in at registration).
 
Yeah I was thinking "viewable on profile pages", initially.

I think it achieves part of the solution, as in, only Admins can view its contents. But you're right, "Editable only once" goes some way to the other part too. The only problem I can foresee with that, though, is the field will be shown to existing users who never got shown that field during registration.

So I think that's the only missing piece. And the only solution I can think for that immediately is a template edit to hide it from the custom fields editing template.

I think permission based fields would be a good addition, though, eventually.

Code:
Viewable by:
    User group A    User group B
    User group C    User group D

Editable by:
   etc...
 
it is actually working fine now as it is, I just do not want to show these "Custom Fields" when user clicks onto "Preferences".

I have also "Editable only once" activated, but the "Custom Fields" are still visible for the user at "Preferences".

I would like to show these "custom fields" to the user at the "Register Page" only, and showing these "custom fields" to Admin only.




May I ask why this suggestion has been marked as "implemented" ?
Is it already possible to achieve this somehow ?

:confused:
 
Last edited:
If the field is editable only once (and it has a value), it doesn't show up on the front-end -- just confirmed it. So yes, that should do it in general. If you're wanting to ensure that it never shows up (even without a value), that could probably be done with a template conditional and is probably something that is more fitting of something specific to you.
 
Template: custom_fields_edit

(Based on the info in your screenshot):
Find:
Code:
<xen:if is="{$field.field_type} == 'textbox'">

Change to:
Code:
<xen:if is="{$field.field_type} == 'textbox' AND {$field.field_id} != 'compwebsite'">

Following Mike's advice above and also setting the field to be not viewable on profiles, plus this template edit basically achieves what you want.
 
Top Bottom