Sample: Profile widget with custom fields

Overview

This sample demonstrates how to add your own custom fields to the default template of the Profile widget. You do this by modifying the Default.cshtml of the Profile widget and then apply the new template to the widget.
For more information, see Profile widget.

Supported field types

For the Profile widget, Sitefinity supports the following field types:

  • Short text
  • Long text
  • Yes / No
  • Date and Time
  • Number

Create the custom widget template

Create a custom template for the Profile widget in the following way:

  1. Open your project in Visual Studio.
  2. In folder Views/Shared/Components, create a new folder and name it SitefinityProfile
  3. In the context menu of folder SitefinityProfile, click Add » New Item…
  4. Name the file ProfileWithCustomFields.cshtml
  5. Paste the code in the template and build your solution

Apply the CAPTCHA template

Perform the following:

  1. Open the page where the Profile widget is located for editing.
  2. In the page editor, hover over the Profile widget.
  3. Click the toggle menu in the widget label.
  4. Click Edit (Edit).
  5. In the Profile template dropdown box, select the new template.
  6. Save your changes.

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

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. 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.

Was this article helpful?