Jump to main content Jump to doc navigation

What is Profile?

Profile sets all the current User's (or a specified User's) Profile fields as placeholders, allowing you to display User Profile information on a page.

Usage

Simply add this Snippet to whatever page you want to set the User's Profile fields as placeholders on:

[[!Profile]]

And then display them with placeholders like such:

<p>Username: [[+username]]</p>
<p>Email: [[+email]]</p>
<p>State: [[+state]]</p>

The password fields are never set as placeholders, and are never accessible, for security reasons.

Profile Properties

Profile comes with some default properties you can override. They are:

Name Description Default
prefix A string to prefix all placeholders for fields that will be set by this Snippet.
user Optional. Either a user ID or username. If set, will use this user rather than the currently logged in one.
useExtended If true, will set as placeholders all extended fields as well. 1

Example

Display the currently logged in user's email and username.

[[!Profile]]

<p>Username: [[+username]]</p>
<p>Email: [[+email]]</p>

Grab the profile for the user 'marksmith', and add a prefix to the placeholders of 'user.':

[[!Profile? &user=`marksmith` &prefix=`user.`]]

Display the currently logged in username's favorite color (an extended field), with the prefix of 'usr.':

[[!Profile? &prefix=`usr.`]]

<p>[[+usr.username]]'s favorite color is [[+usr.color]]</p>

See Also

  1. Login.Login
  2. Login.Profile
  3. Login.UpdateProfile
  4. Login.Register
    1. Register.Example Form 1
  5. Login.ConfirmRegister
  6. Login.ForgotPassword
  7. Login.ResetPassword
  8. Login.ChangePassword
  9. Login.Tutorials
    1. Login.Basic Setup
    2. Login.Extended User Profiles
    3. Login.Request Membership
    4. Login.User Profiles
    5. Login.Using Custom Fields
    6. Login.Using Pre and Post Hooks

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Digital Penguin
  • Dannevang Digital
  • Sepia River Studios
  • CrewMark
  • Chris Fickling
  • deJaya
  • Following Sea
  • Anton Tarasov
  • eydolan
  • Raffy
  • Lefthandmedia
  • Murray Wood
  • Snow Creative
  • Nick Clark
  • Helen
  • JT Skaggs
  • krisznet
  • YJ
  • Yanni
  • Richard

Budget

$366 per month—let's make that $500!

Learn more