S1 Display User Data

Use the S1 tag to display user data for a logged-in user such as name and address. The value rendered will be an attribute or preference for the current Constituent. Interests are stored as preferences, so this tag can also return the user's preference for a specific interest category. For example, to greet the logged in user by first name, code it as:

Hello, [[S1:first_name]]!

Application

Platform

Can You Add This S-Tag in the Content Editor?

Yes

Can You Add This S-Tag in the Luminate CMSContent Editor?

Yes

Format

Parameters

An attribute identifier is the value of the ID attribute of an AttrCfg element in the SiteAttrCfg XML file. For example, [[S1:cons_id]] will be substituted with the constituent ID of the current user/constituent.

Note: this syntax is preferred over the second, special identifier, syntax.

The special identifiers are as follows:

Description

Attribute Identifier

Constituent Identifier

cons_id

User Name

user_name

Clear Text Password

Note: Renders a link to reset password if new user login flow is enabled (USER_SECURITY_ENHANCEMENTS_ENABLED=true)

user_password

Title/Honorific

cons_title (e.g. "Ms.")

First/Given Name

first_name

Middle Name

middle_name

Last Name or Surname

last_name

Suffix, such as Jr. or Sr.

cons_suffix

A Professional Qualifier, such as PhD

cons_prof_suffix

Home Email Address

home_primary_email

Home Address - First line

home_street1

Home Address - Second line

home_street2

Home Address - Third line

home_street3

Home Address - City

home_city

Home Address - State or Province

home_stateprov

Home Address - Zip or Postal Code

home_zip

Home Address - Country

home_country

Home Phone Number

work_phone_number

Work Email Address

work_primary_email

Work Address - First line

work_street1

Work Address - Second line

work_street2

Work Address - Third line

work_street3

Work Address - City

work_city

Work Address - State or Province

work_stateprov

Work Address - Zip or Postal Code

work_zip

Work Address - Country

work_country

Work Phone Number

work_phone_number

Sample Code

Note: As a best practice, do not use the S1 tag to display transactional data, such as payment amounts or dates, due to inconsistent behavior with the tag. There is no guarantee the data will be written to the database before it is accessed.

Using the S1 Tag to See if a User is Logged In

The S1 tag allows you to see if a user is logged in and display content accordingly.

  1. Open a PageBuilder page.
  2. Insert the following content:[[?xx::x[[S1:user_name]]x::You are not logged in.::You are logged in.]]This code tests whether a given user is logged in or not. If the [[S1:user_name]] returns a value, it will be the user name, flanked by x's. Obviously, something like "xgreenRunnerx" will not match "xx" (there will only be a match if the tag returns nothing).
  3. Save the document.
  4. Visit the page as a guest visitor. Confirm that the message, "You are not logged in," displays.
  5. Log in and visit the page as a logged in user. Confirm that the "You are logged in" message displays.