Profile
Last updated Mar 6th, 2021 | Page history | Improve this page | Report an issue
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
Budget
$301 per month—let's make that $500!
Learn moreWhat 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¶
- Login.Login
- Login.Profile
- Login.UpdateProfile
- Login.Register
- Login.ConfirmRegister
- Login.ForgotPassword
- Login.ResetPassword
- Login.ChangePassword
- Login.Tutorials
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
Budget
$301 per month—let's make that $500!
Learn more