Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Developing with Sitefinity > Custom provider: Add custom properties that are visible in sitefinity and extend user administration

Custom provider: Add custom properties that are visible in sitefinity and extend user administration

  • Panos Klaoudatos avatar

    Posted on Nov 25, 2008 (permalink)

    Hi all,

    Let's say we implement a custom provider or even extend the Sitefinity default one.
    I need to add custom properties to the profile section, (e.g. Address1,City,State, etc,

             <add name="Address1"/>
             <add name="Address2"/>
             <add name="City"/>
             <add name="State"/>
             <add name="Zip" />
             <add name="PhoneNumber"/>
             <add name="Gender"/>
    )
    and I need these custom properties to be visible in the Sitefinity user profile, in the User Details section (like FirstName and LastName already shown).
    Furthermore, would it be possible to add more columns in the users administrating grid, like for example the Gender custom property (next to creation date)? Having said that, is it possible to add these custom properties to the search combox so that the administrator can search for users by gender, city, etc?

    Panos

    Reply

  • valio b valio b admin's avatar

    Posted on Nov 25, 2008 (permalink)

    Hello Panos Klaoudatos,

    Please have a look at this project and let us know if it helps:

    http://blogs.sitefinity.com/Ivan/Post/08-01-17/sitefinity_social_network_platform_part_2_setting_up_public_side_membership.aspx

    Also you may find the below thread interesting:

    http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-hebcb.aspx

     And from the UserManual (p.230):

    Adding User Details

    You can extend the user profile with additional fields from the application web.config file. Follow the

    steps below to add the field Nickname.

    1. Open the application web.config file. Find this section and add the new profile property:

    <profile defaultProvider="Sitefinity">

    <providers>

    <clear/>

    <add name="Sitefinity" connectionStringName="DefaultConnection"

    applicationName="/"

    type="Telerik.DataAccess.AspnetProviders.TelerikProfileProvider,

    Telerik.DataAccess"/>

    </providers>

    <properties>

    <add name="FirstName"/>

    <add name="LastName"/>

    <add name="Nickname"/>

    </properties>

    </profile>

    2. To display the field at the Administration > Create/Edit User screens, open the

    ~/Sitefinity/Admin/CmsAdmin/Users.aspx file add the lines in red:

    A.

    <cc1:ManageUsers runat="server" ID="manageUsers">

    ...

    <InsertTemplate>

    ...

    <div class="workArea">

    <div class="mainForm">

    ...

    <fieldset class="userinfo set">

    <cc1:ManageProfile ID="manageProfile" runat="server"

    Mode="Insert">

    <InsertTemplate>

    <ol class="setIn">

    <!-- Add the new profile field HERE. For example:

    <li>

    <cc2:FieldLabel ID="lblNickname" runat="server"

    Text="Nickname"

    TargetID="Nickname"></cc2:FieldLabel><asp:TextBox

    ID="Nickname"

    runat="server"></asp:TextBox>

    </li>

    -->

    B.

    <cc1:ManageUsers runat="server" ID="manageUsers">

    ...

    <EditTemplate>

    ...

    <div class="workArea">

    <div class="mainForm">

    ...

    <fieldset class="userinfo set">

    <cc1:ManageProfile ID="manageProfile" runat="server"

    Mode="Insert">

    <EditTemplate>

    <ol class="setIn">

    <!-- Add the new profile field HERE. For example:

    <li>

    <cc2:FieldLabel ID="lblNickname" runat="server"

    Text="Nickname"

    TargetID="Nickname"></cc2:FieldLabel><asp:TextBox

    ID="Nickname"

    runat="server"></asp:TextBox>

    </li>

    -->

    3. To allow users to change their nickname in My Profile, open the

    ~/Sitefinity/Admin/CmsAdmin/MyProfile.aspx file and add the field as shown below:

    <asp:MultiView runat="server" ID="MultiView1">

    <asp:View runat="server" ID="ProfileView">

    <div class="workArea insert">

    <div class="mainForm">

    ...

    <fieldset class="userinfo set">

    <cc1:ManageProfile ID="manageProfile" runat="server"

    Mode="edit">

    <EditTemplate>

    <ol class="setIn">

    <!-- Add the new profile field HERE. For example:

    <li>

    <cc2:FieldLabel ID="lblNickname" runat="server"

    Text="Nickname"

    TargetID="Nickname"></cc2:FieldLabel><asp:TextBox

    ID="Nickname"

    runat="server"></asp:TextBox>

    </li>

    -->

     Hope this was helpful!


    All the best,
    valio b
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

    Reply

  • Panos Klaoudatos avatar

    Posted on Nov 26, 2008 (permalink)

    Yeah,

    that's what I was looking for.

    Thanks

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Developing with Sitefinity > Custom provider: Add custom properties that are visible in sitefinity and extend user administration