1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / 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

3 posts, 0 answered
  1. Panos Klaoudatos
    Panos Klaoudatos avatar
    8 posts
    Registered:
    14 Aug 2012
    25 Nov 2008
    Link to this post
    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

  2. valio b
    valio b avatar
    33 posts
    Registered:
    24 Sep 2012
    25 Nov 2008
    Link to this post
    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.
  3. Panos Klaoudatos
    Panos Klaoudatos avatar
    8 posts
    Registered:
    14 Aug 2012
    26 Nov 2008
    Link to this post
    Yeah,

    that's what I was looking for.

    Thanks
Register for webinar
3 posts, 0 answered