Notifications
Clear all

wpForo 1.x.x [Closed] How do we set character limits for the Display Name Field and the Nickname fields?

4 Posts
2 Users
0 Reactions
1,425 Views
Posts: 281
Topic starter
(@crisw)
Reputable Member
Joined: 6 years ago

Hi Support Team! 🙂

We've been testing another new Forum and noticed that the character limits for the Display Name text field is quite big and if anyone inputs a Display Name at 70 characters, it can make the Forum look broken. Same with the Nickname, with maximum characters of 50.

I was able to put a CSS Code as a workaround,

- for the Nickname, it breaks and wraps

- for the Display Name, it gets hidden after about 20 characters, however, when such a user with a long display name clicks the "like" button, then the full long Display Name appears as well. (please see attached screenshot).

What file do I need to tweak so that I can set the character limits for the text fields for both the Display Name and the Nickname to 12 characters, on the My Profile Page, Account tab?

Thanks in advance!

3 Replies
Alvina
Posts: 1863
Moderator
(@alvina)
Member
Joined: 5 years ago

Hi @crisw,

I've just asked our developers about it and currently, I'm waiting for the response from them. I'll update the topic one I get some response from them.

Posts: 281
Topic starter
(@crisw)
Reputable Member
Joined: 6 years ago
Posted by: @alvina

Hi @crisw,

I've just asked our developers about it and currently, I'm waiting for the response from them. I'll update the topic one I get some response from them.

Hi @alvina,  Thanks for responding and getting your developers to look into this. In the meantime, I have temporarily used the code below to hide the "Display Name" from the Account Profile.  I thought I would share it here, in case others might want to use it too.  

I was able to tweak the WP Core user file, so our WP site now has only 12 character limits for the Username (which on the forum, gets duplicated into the "Display Name" and the "Nickname" fields by default). 

The issue I see in the form at the Member's Account Profile, on the "Display Name" text field, it seems to not have a maxlength character limit on the field itself, so if anyone inputs extremely long Display Name, it will break the forum layout ("Profile", "Post" Box, and the "Likes"  as shown in above screenshot). 

So in the mean time, I put the codes below (Forum Settings > Styles > Custom CSS) 

/*Do not display Display Name Label & Text Field - PROFILE PAGE*/
div.wpf-field.wpf-field-type-text.wpf-field-name-display_name.wpf-field-required {
display: none;
}

 

And since the Nickname field also has a maxlength of 50 characters, it also protrudes through the comment box, and does not look good so, I also added this code below: 

/*Automatically adjust long Nicenames or Nicknames to responsively fit smaller screens - COMMENT BOX*/

div.wpf-author-nicename {
white-space: wrap !important;
max-width: 90% !important;
width: 90% !important;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
}

 

I hope that the Developers can look into the max-length of the field names for "Display Name" and "Nickname".  

Thanks!  God bless you! 🙂 

 

 

 

Related: 

How to hide some fields in the user's Account Profile  

https://wpforo.com/community/how-to-and-troubleshooting-2/trouble-when-removing-social-networks-fields-in-profile/#post-28480

 

 

1 Reply
Alvina
Moderator
(@alvina)
Joined: 5 years ago

Member
Posts: 1863

@crisw,

You can use the CSS solution provided by you, or you should customize each file and limit the characters.