Tip: Force DISPLAYNAME to a predetermined pattern

Blog 2
Location: BlogsAll BlogsDNN Tips    
Posted by: mamlin 4/13/2009 5:17 AM

For sites where users' DISPLAYNAMEs are made public (via forum postings, etc) it is desirable to allow users to pick their own DISPLAYNAME values. If you have a site where DISPLAYNAMEs are NOT public, however, you may save yourself some headache by forcing DISPLAYNAME to a predetermined pattern (plus you'll simplify your site signup process to boot...)
 
 
DISPLAYNAME
The "DISPLAYNAME" field is a "User Credentials" field.  This is not to be confused with "User Profile" fields.  "Profile" fields are optional (subject to a portal's User Profile settings).  "Credentials" fields are required and, as such, are included as part of the required fields during user account registration.  DISPLAYNAME is the one "Credentials" field you can exclude from the default registration process (by specifying a pattern).
 
Before we get to forcing a DISPLAYNAME value via a pattern, though, we should note that in many cases it is desirable to allow users to chose their own DISPLAYNAME.  This is especially true on sites that publish users' DISPLAYNAMES (as in those that elect to show DISPLAYNAME in the USERS ONLINE module or in various forums modules).  In such cases, if your site forces the DISPLAYNAME to be a user's actual name (or email address), some users may elect to supply a fake name for FIRSTNAME and/or LASTNAME in order to better protect the users' privacy.  We saw this very thing happen (briefly) on the DotNetNuke.com site forums in late 2007.
 
 
Forcing a Pattern - Why Bother?
Why might we want to force the DISPLAYNAME to a certain pattern?  The most common pattern is to force it to is FIRSTNAME + LASTNAME (resulting in a user's FULLNAME value).  But why would we want to force DISPLAYNAME to repeat information we already have? 
 
Forcing DISPLAYNAME to an existing value may or may not be of benefit to a particular site/admin.  Here are a few reasons you might choose to force such a pattern:

  • Simplify user registration process (users do not have to pick a DISPLAYNAME)
  • Reduce chances of user confusion with regard to difference between USERNAME and DISPLAYNAME
     
  • Improve default EVENTS module enrollment management (list of enrolled users can be displayed by "Lastname, Firstname" or by email address instead of a user-selected DISPLAYNAME)

It was the EVENTS enrollment list (in a much older version of the current EVENTS module) that first prompted me to force a certain DISPLAYNAME for a particular portal.  I had a common complaint from event administrators: many users were hard to identify on DISPLAYNAME alone (there were multiple users who picked display names of just "Bob", for example).  I wanted to avoid any change to the core EVENTS module code but I also wanted a solution that did not require me to provide a custom admin interface.  Forcing the DISPLAYNAME to a predetermined pattern based on the users' names was the answer.  After forcing a DISPLAYNAME pattern I then realized the additional benefits of simplifying the portal's regsitration process and avoiding user confusion over the difference between a DISPLAYNAME and a USERNAME.  Over the next year I began to adopt the "DISPLAYNAME pattern" as part of my default configuration for new DNN sites.  I now only allow user-determined DISPLAYNAMES when it is required (primarily on sites with forums.

How to force a DISPLAYNAME pattern
The DNN setting for specifying a DISPLAYNAME pattern is found under:
 
  ADMIN -> USER ACCOUNTS -> USER SETTINGS -> DISPLAY NAME FORMAT.  
 
You can enter DNN tokens as well as fixed strings.  I like to use a pattern that results in "Lastname, Firstname" so my pattern with DNN tokens is:
 
   [LASTNAME], [FIRSTNAME]
 
Of course, you're not limited to just using DNN tokens.  For example, if you ran a Monty Python fan site, you might decide to use a fixed string "Bruce" resulting in everyone having the DISPLAYNAME of...."Bruce".  To distinguish between "New Bruces" you might also include the userid value, such as in "Bruce [USERID]".  Inclusion of the userid value may also make sense when using actual user names so you can tell the difference, for instance, between two different "Bob Smith" members on the same portal.
 
 
Summary
Hopefully this tip was useful if:

  1. It helped you identify an easy way to simplify your user registration process without altering core code or buying a third party module.
     
  2. It helped you avoid confusion over DISPLAYNAMEs (admin confusion over duplicate DISPLAYNAMEs and/or user confusion between USERNAME and DISPLAYNAME).
     
  3. It helped you avoid potential user privacy concerns by knowing why you may NOT want to take away users' ability to chose their own DISPLAYNAME values.

 
 If you've used DNN's DISPAYNAME pattern feature to help solve a particular issue, please share it in the comments, below.

Permalink |  Trackback

Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 
You are here:  
 
>> Back to the top of the blog list...

 
        account   blog   click   cloud   code   create   data   events   example   feature   file   files   free   function   good   google   just   line   links   list   module   modules   need   note   number   option   page   pages   query   results   role   roles   script   search   select   settings   simple   site   skin   solution   step   tags   terms   time   user   users   value   version   want  
Minimize Google AJAX Search
 
Search ES:  
This is an example of a Google AJAX Search with asynchronous search execution for two searches.  See our blog series, 'Add Google AJAX Search to your DNN skin' for info and sample code.
 
     
Minimize Buy Stuff
 
Stuff by Eguana Solutions
(Be sorta cool!)
 
     
Minimize Most-Commented Blogs
 
 
     

Minimize Looking for more info?
 

There are tons of helpful
posts from Eguana Solutions 
on the DotNetNuke.com forums.
  
 
Click HERE to see our posts.

 
     
Minimize Modules for Sale
 

Looking for Eguana's modules? 
We're still working on them!
  

Until ours are ready to dazzle and
amaze, you'll have to make do with
the thousands of modules already
available on SnowCovered.

 
     
Minimize Favorite Modules
 

There are many great DNN modules.
A few we highly recommend are:
 
Dynamic Registration
Total control over the user signup process.  Create custom forms, execute your own SQL, use the integrated payment processing features to assign user roles, validate USERNAMEs via AJAX and much more.  Very cool.
 
URL Master
Change to friendly URLs that really ARE friendly.  Add keywords into your page URLs for better SEO.  Create 301 redirects for individual pages.  Force visitors (and search bots) to a single domain (i.e., make everyone use the "www" version of your site's URL or vice versa).  One of the single best upgrades for any DNN site.
 
Document Exchange 5 (DMX5)
Drag-and-drop from Windows Explorer directly into the DMX file manager!  File versioning, file and folder moderation, extend user permissions down to the file level (for user groups and even for individual users).  Infinite file and file info presentation options via custom display templates.  Store files locally or remotely via UNC (i.e., can securely store files somewhere besides your web server).  Much more.
 
XMOD by DNNDev
Rock-solid form module for data collection.  From simple feedback / email forms to complex, multi-part tabbed forms.  XMOD is different from other form modules because XMOD does not create a new database table for every new form definition -- an important feature if you plan to create dozens or hundreds of forms over the life of your DNN instance!  Excellent support from the developer and an active community around this module.
 
If you desire your form module to create a new DB table for each new form definition, a great alternative to XMOD is the Dynamic Forms module from DataSprings.  Dynamic Forms offers direct DB access beyond that found in XMOD as well as an easy drag-and-drop form builder option to help you get up and running very quickly.

 
     

Login