Learn@UW - Using Replace Strings

This document describes the replace strings, sometimes referred to as display variables, that are available and where they are used.

Replace strings are variable names enclosed in curly braces {} that are automatically replaced by the corresponding variable values.   For example, if you enter the text {OrgUnitID} into the document, when you view the document, you will see the Organization Unit ID (ou #) of the course.

Replace strings are used in all tools that use the HTML editor.  However, evaluation rules for the replace strings vary with the tool as follows:

  1. For the Content tool, replace strings are evaluated only once when the Content topic is first saved.  Thereafter, there is no record of a replacement string having been entered.  For example, if you enter {OrgUnitID} into a Content topic in course 'A' and later copy that Content topic into course 'B', the ou # of course 'A' course will display in the Content topic in course 'B'.  If braces surrounding text do not form a valid replace string that applies to the Content tool, they may possibly display as double braces ( {{ and }} ) within the HTML editor, but they will display normally as single braces when the Content topic is viewed.

  2. For all other tools, the replace string is evaluated each time the document containing the replace string is viewed. For example, if you enter {OrgUnitID} into a News item in course 'A' and later copy that News item into course 'B', the ou # of course 'B' will display in the News item in course 'B'. 

  3. Not all replace strings apply to all tools as described below.

Replace strings are particularly useful within the following:

  • Course Homepage Widgets
  • Custom Navigation Bar Links
  • Navigation Bars
  • Mail Templates

For example, if the text {UserName} is in the code of a custom widget for a course home page, users in that course will see their user names displayed.

The available replace strings are:

For the Current Organization
{OrgId} ID # of the organization.
{OrgName} Name of the organization.
   
For the Current Organization Unit
{OrgUnitId} ID # of the organization unit.
{OrgUnitName} Name of the organization unit.
{OrgUnitCode} Code for the organization unit.
{OrgUnitTypeId} ID number of the type of the organization unit.
{OrgUnitPath} Path to files for the organization unit.
   
For the Current User (Not Used in Content Tool)
{UserId} ID number of the user. This value is used internally by the system.
{UserName} Full name of the user. This is what the user enters to logon.
{OrgDefinedId} Organization ID. This is an identifier specified by the campus for the user.
{FirstName} First name of the user.
{LastName} Last name of the user.
{Email} User's internal email address.
{ExternalEmail} User's external email address.
{InternalEmail} User's internal email address.
   
The User's Role in the Current Organization Unit (Not Used in Content Tool)
{RoleId} Internal ID # for user's role.
{RoleCode} Code for user's role.
{RoleName}
Name of user's role.
   
These are Only Used in Mail Templates:
{HelpDeskEmail} Email address of the Help Desk.
{HelpDeskName} Name for the Help Desk.
{LoginPath} URL of the login path for this site.
{PasswordResetLink} Link for users to reset their passwords.



Keywords:brightspace learn@uw learnuw d2l desire2learn replace strings display variable curly brace value no longer available external email known issue   Doc ID:3385
Owner:Joan W.Group:Learn@UW Utility
Created:2004-12-02 19:00 CDTUpdated:2016-05-24 14:33 CDT
Sites:DoIT Help Desk, DoIT Tech Store, Learn@UW Madison, Learn@UW Utility
Feedback:  20   3