---
title: Example - Editing partner profiles
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

In this example, you will create a list of business partners who will be able to edit their profile on the **My profile** page after they have signed in. This example assumes that you are using the sample Corporate Site.

## Creating the Partner profile page type

The Partner profile page type will store the name and text description of the partner.

1. Open the **Page types** application.
2. Click **New page type**.
3. In Step 1 of the New page type wizard, enter the following, then click **Next**:

   - **Page type display name**: Partner profile
   - **Namespace**: custom
   - **Name**: PartnerProfile

   ![Step 1 of the New page type wizard](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/creating_page_type.png "Step 1 of the New page type wizard")
4. In Step 2, leave the default values and click **Next**.
5. In Step 3, add two attributes to the page type using the **New field** and **Save** buttons:
   - Partner name field

     - **Field name**: PartnerName
     - **Field type**: Text
     - **Required**: yes
     - **Field caption**: Partner name
     - **Form control**: Text box
   - Partner profile field

     - **Field name**: PartnerProfile
     - **Field type**: Long text
     - **Field caption**: Partner profile
     - **Form control**: Rich text editor

     ![Adding fields to the page type](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/fields_for_page_type.png "Adding fields to the page type")
6. Click **Next**.
7. In Step 4, select _**PartnerName**_ in **Page name source**.
8. Click **Next** in each of the remaining steps to finish the process.

The system creates a new page type named Partner profile.

## Creating the partner list page

The partner list page will display a list of partner profile pages.

1. Open the **Pages** application.
2. Select the **Examples** page.
3. Click **New** () and select the **Page (menu item)** page type.
4. Type _**Partner directory**_ as the Page name, select **Create a blank page** and click **Save**.

   ![Creating a new blank page](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/creating_partner_directory_page.png "Creating a new blank page")
5. Switch to the **Design** tab and add the **Repeater** web part to the page.
6. Set the following repeater properties:

   - **ID:** repeaterPartners
   - **Page types:** custom.PartnerProfile
   - **Transformation:** custom.PartnerProfile.Default
   - **Selected item transformation:** custom.PartnerProfile.Default
7. Click **Save & Close**.

The system creates a page which will display a list of partner profile pages.

## Creating the partner user account

Now create a sample user which we will use in the examples.

1. Open the **Users** application.
2. Create a new user with the user name _**AAAWebDesign**_.
3. Set the user's **Privilege level** to _**None**._

   ![Creating the sample AAAWebDesign user](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/creating_sample_user.png "Creating the sample AAAWebDesign user")
4. Click **Save**.
5. Switch to the **Roles** tab and add the user to _**CMS Basic users**_.

You have created a user whose partner portal page you will create in the following procedure.

## Creating the partner profile page

1. Open the **Pages** application.
2. Select the **Examples -> Partner directory** page.
3. Click **New** () and select the **Partner profile** type.
4. Enter the following information and click **Save**:
   - **Partner name:** AAA Web Design Inc.
   - **Partner profile:** We provide web development services.![Creating a new page of the Partner profile type](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/creating_partner_profile.png "Creating a new page of the Partner profile type")
5. Open the **Properties -> URLs** tab.
6. Set the **Page alias** to _**AAAWebDesign**_ and click **Save**.

   - You need to use the same alias as the user name since you will be using them to match the users to their user profiles.
   - The alias path of the page will always be _/Examples/Partner-directory/_.

When you display the page in **Preview** mode now, you will see a page similar to this:

![Previewing the partner page](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/partner_dir_preview.png "Previewing the partner page")

## Creating the partner profile editing page

Now you will create a page that will be available only to partners and that will allow them to edit their partner profile.

1. Open the **Pages** application.
2. Select the **Examples** page.
3. Click **New** () and select the **Page (menu item)** type.
4. Type _**My profile**_, choose the **Create a blank page** option and click **Save**.

   ![Creating a new page for editing partner profiles](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/creating_myprofile_page.png "Creating a new page for editing partner profiles")
5. Switch to the **Design tab** of the newly created page and add the **Repeater** web part.
   - The repeater will display the current user's partner profile.
6. Set the following properties for the repeater and click **Save & Close**.

   - **ID:** repeaterPartners
   - **Path:** /Examples/Partner-directory/{%CurrentUser.UserName#%}
     - This ensures that the page displays the profile that matches the current user.
     - The {%CurrentUser.UserName#%} macro is resolved as the user name of the current site visitor.
   - **Page types:** custom.PartnerProfile
   - **Transformation:** custom.PartnerProfile.Default
   - **Selected item transformation:** custom.PartnerProfile.Default
   - **Hide if no record found:** no (clear the check-box)
   - **No record found text:** No partner profile was found for your user account.
   - **Content before:** Your Partner Profile
7. Add the **User contributions/Edit contribution** web part, set the following properties for the web part and click **Save & Close**.
   - **Path:**/Examples/Partner-directory/{%CurrentUser.UserName#%}
     - This ensures that the form edits a profile matching the current user.
     - The {%CurrentUser.UserName#%} macro is resolved as the user name of the current site visitor.
   - **Allow delete:** no (clear the check box)
     - This option hides the **Delete** button as you don't want the partners to delete their profile accidentally.
   - **Allow editing by users:** Authenticated
     - You want to allow editing only to authenticated users. At the same time, you don't require the user to be a page owner.
8. Open the **Properties ->** **Security** tab.
9. Set the **Requires authentication** value to **Yes** and click **Save**.
   - This will enable access to this page only to the authenticated partners so that you know their user name for displaying their profile.

You have created a page that will allow the partners to edit their profiles.

## Testing the profile editing page

1. Sign out and go to **Examples -> My profile** page (you can find a link at the bottom of the page).

   - The system displays a logon form.
2. Sign in as user _**AAAWebDesign**_ and you will see your partner profile with the **Edit** link.

   ![Partner profile page](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/preview_partner_profile.png "Partner profile page")
3. Click **Edit** to open the edit dialog window,modify some values and click **Save**:

   ![Editing the partner profile](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/preview_editing_partner_profile.png "Editing the partner profile")
4. Go to **Examples -> Partner directory** page and you will see the updated profile.

   ![Edited partner profile](https://docs.kentico.com/docsassets/k81/example-editing-partner-profiles/preview_edited_partner_profile.png "Edited partner profile")

> **Info:** **Hint 1: Simplifying the process of creating a new partner**
>
> You can develop a custom page (see [Custom development](https://docs.kentico.com/k81/custom-development.md)) containing a form for creating new partners, including code that automatically creates user accounts and partner profile pages with a corresponding alias path.

> **Info:** **Hint 2: Assigning multiple users to the same partner profile**
>
> If the user name/page alias path mapping does not fit your needs or if you need to assign multiple users to the same partner profile, you can use another option:
>
> 1. Open the **Modules** application.
> 2. Edit the **Membership** module.
> 3. Open the **Classes** tab and edit the **User** class.
> 4. On the **Fields** tab, create a custom text field for users, for example named _**PartnerProfileAliasPath**_.
>
> You can then use the custom field to specify which pages users can edit as partner profiles. Set the **Path** property of the **Edit contribution** web part using a matching [macro expression](https://docs.kentico.com/k81/macro-expressions.md), such as _**{% CurrentUser.PartnerProfileAliasPath %}**_.
>
> **Note**: When configuring user accounts, you can find custom fields on the **Custom fields** tab.
