Profile widget

You use the Profile widget to preview and edit user profile details. Depending on the widget configuration, you can use the widget for the current user or for any other user.

Configure edit mode

  1. Open the Profile widget designer.
  2. Select the Edit mode only and choose what you want the system to do when profile changes are saved:
      Edit will be available in the drop down.

    Configure read mode

    1. Open the Profile widget designer.
    2. Select Read mode only and choose a template.
      By default, there is just one ProfileEdit template out of the box. Any other view template that exists in~/Mvc/Views/Profile and starts with Read will be available in the drop down.

    Configure both modes

    To enable users to see their profiles in preview with the option to edit it, do the following:

    1. Open the Profile widget designer.
    2. Choose what you want the system to do when changes are saved:
      • Switch to Read mode
        Returns the user to read mode where the changes are applied.
      • Show a message above form
        Renders a simple message above the form to notify the user that the changes are applied.
      • Open a specially prepared page...
        Select a Sitefinity CMS page that the user will be redirected to after saving the profile.
    3. Choose a preview template.
      By default, there is just one ProfileEdit template out of the box. Any other view template that exists in~/Mvc/Views/Profile and starts with Read will be available in the drop down.
    4. Choose an edit template.
      By default, there is just one ProfileEdit template out of the box. Any other view template that exists in~/Mvc/Views/Profile and starts with Edit will be available in the drop down.

    Advanced configuration

    1. To set up the Profile widget to display the profile of a specific user:
      1. Fill out the UserName field with the user name of the user
      2. If the user is from a non-default membership provider, modify MembershipProvider
    2. Specify how profile properties are bound to the form using the ProfileBindings property:
    3. If you have a custom field for the User profile widget, use this snippet to display and access the field in the widget view template:

      In the code above, replace the CustomFieldName with the actual name of the custom field.

    4. If you have a custom field for profiles that you want to be editable, add it in the Properties collection just like the default fields. The model of the profile widget will have a Profile dictionary containing the properties that are mapped in the ProfileBindings, like the one below:
      @Html.TextBoxFor(u => u.Profile["FirstName"])

    Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

    Web Security for Sitefinity Administrators

    The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

    Foundations of Sitefinity ASP.NET Core Development

    The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

    Tags

    Was this article helpful?

    Next article

    Users list widget