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.
$125 per month—let's make that $500!Learn more
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.
Simply add this Snippet to whatever page you want to set the User's Profile fields as placeholders on:
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 comes with some default properties you can override. They are:
|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|
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>