Profile Widget External Template

Posted by Community Admin on 05-Aug-2018 23:34

Profile Widget External Template

All Replies

Posted by Community Admin on 14-Mar-2012 00:00

How do I assign an external widget template to the Profile widget? From what I can see, I can edit a template or create a new one, but the Advanced tab shows nothing, so I don't see where I would assign my external template.

Posted by Community Admin on 16-Mar-2012 00:00

Hello,

I have logged this bug and  we are currently working on fixing it. I hope we will be able to provide a solution for the next releases.

To solve your problem I will give you a sample template:

<%@ Control Language="C#" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Fields" Assembly="Telerik.Sitefinity" %>
<div class="sfprofileArticleLikeWrp">
    <asp:PlaceHolder ID="itemContainer" runat="server">
        <sf:ImageField ID="predefinedImageField" runat="server" DataFieldType="Telerik.Sitefinity.Model.ContentLinks.ContentLink"
            DisplayMode="Read" ShowDeleteImageButton="false" CssClass="sfprofileField sfprofileAvatar"
            DefaultSrc="~/SFRes/images/Telerik.Sitefinity.Resources/Images.DefaultPhoto.png"
            DataFieldName="Avatar" />
        <div class="sfprofileName sfprofileField">
            TEST
            <sf:TextField ID="firstName" runat="server" DataFieldName="FirstName" DisplayMode="Read"
                Title="<%$ Resources:Labels, FirstName %>" CssClass="sfprofileFirstName" />
            <sf:TextField ID="lastName" runat="server" DataFieldName="LastName" DisplayMode="Read"
                Title="<%$ Resources:Labels, LastName %>" CssClass="sfprofileLastName" />
        </div>
        <sf:TextField ID="about" runat="server" DataFieldName="About" DisplayMode="Read"
            Title="<%$ Resources:Labels, About %>" CssClass="sfprofileField sfprofileAbout" />
    </asp:PlaceHolder>
    <div class="sfprofileLnkWrp">
        <asp:HyperLink runat="server" ID="editProfile" Text="<%$ Resources:UserProfilesResources, EditProfile %>"
            CssClass="sfprofileEditLnk" />
        <asp:HyperLink runat="server" ID="changePasswrod" Text="<%$ Resources:Labels, ChangePassword %>"
            CssClass="sfprofileChangePasswordLnk" />
    </div>
</div>

Create a new control in your project and add the source code. To use the control you should change the template path in the user profiles frondend details. Please take a look at this video and follow the steps.



All the best,
Stefani Tacheva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 18-Mar-2012 00:00

Thank you for your reply.

This seems to mean I would lose the original template, but I still need it.

We can propably work around using an external template and just create one in the back end, however, when we add field using the Template editor, no title caption is shown, as in:

<sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("Address1")%>' />

I tried modifying to the following, but still no caption is shown for the field:
<sf:TextField ID="Address1" runat="server" DataFieldName="Address1" DisplayMode="Write" Title="<%$ Resources:Labels, Address1 %>" CssClass="sfprofileField" WrapperTag="li" />

but I get "error parsing the template".

This is for a custom profile type, not just additional field to the basic profile type.

Posted by Community Admin on 20-Mar-2012 00:00

Hello,

Add your text field in the <div>:

<%@ Control Language="C#" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Fields" Assembly="Telerik.Sitefinity" %>
<div class="sfprofileArticleLikeWrp">
    <asp:PlaceHolder ID="itemContainer" runat="server">
        <sf:ImageField ID="predefinedImageField" runat="server" DataFieldType="Telerik.Sitefinity.Model.ContentLinks.ContentLink"
            DisplayMode="Read" ShowDeleteImageButton="false" CssClass="sfprofileField sfprofileAvatar"
            DefaultSrc="~/SFRes/images/Telerik.Sitefinity.Resources/Images.DefaultPhoto.png"
            DataFieldName="Avatar" />
        <div class="sfprofileName sfprofileField">
            TEST me again
            
 
            <sf:TextField ID="firstName" runat="server" DataFieldName="FirstName" DisplayMode="Read"
                Title="<%$ Resources:Labels, FirstName %>" CssClass="sfprofileFirstName" />
            <sf:TextField ID="lastName" runat="server" DataFieldName="LastName" DisplayMode="Read"
                Title="<%$ Resources:Labels, LastName %>" CssClass="sfprofileLastName" />
            <sf:TextField ID="Address1" runat="server" DataFieldName="Address1" DisplayMode="Read"
                Title="<%$ Resources:Labels, LastName %>" CssClass="sfprofileLastName" />
 
        </div>
        <sf:TextField ID="about" runat="server" DataFieldName="About" DisplayMode="Read"
            Title="<%$ Resources:Labels, About %>" CssClass="sfprofileField sfprofileAbout" />
    </asp:PlaceHolder>
    <div class="sfprofileLnkWrp">
        <asp:HyperLink runat="server" ID="editProfile" Text="<%$ Resources:UserProfilesResources, EditProfile %>"
            CssClass="sfprofileEditLnk" />
        <asp:HyperLink runat="server" ID="changePasswrod" Text="<%$ Resources:Labels, ChangePassword %>"
            CssClass="sfprofileChangePasswordLnk" />
    </div>
</div>

After that you should add this field in the basic profile of the user. Please look at the video I have recorded.

Kind regards,
Stefani tacheva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 20-Mar-2012 00:00

The field is being added to the <div>. Here is what I have:

<%@ Control Language="C#" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Fields" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
 
<sf:SitefinityLabel runat="server" id="successMessageLabel" Visible="false" WrapperTagName="div" HideIfNoText="false" CssClass="sfprofileSuccessMsg" />
 
<fieldset id="formWrapper" runat="server" class="sfprofileEditFormWrp">
    <sf:SitefinityLabel runat="server" id="errorLabel" Visible="false" WrapperTagName="div" HideIfNoText="false" CssClass="sfprofileFailureMsg" />
    <asp:PlaceHolder ID="itemContainer" runat="server">
        <ol class="sfprofileFieldsList">
                     <sf:TextField ID="Address1" runat="server" DataFieldName="Address1" DisplayMode="Write" Title="<%$ Resources:Labels, Address1 %>" CssClass="sfprofileField" WrapperTag="li" />
 
                    </ol>
    </asp:PlaceHolder>
    <div class="sfprofileLnkWrp">
        <asp:Button runat="server" ID="saveChanges" Text="<%$ Resources:UserProfilesResources, SaveChanges %>" CssClass="sfprofileSaveLnk" />
        <asp:HyperLink runat="server" ID="cancel" Text="<%$ Resources:UserProfilesResources, Cancel %>" CssClass="sfprofileCancelLnk" />
    </div>
</fieldset>


The <Title> part seems to be the problem. if I change
Title="<%$ Resources:Labels, Address1 %>"
to:
Title="<%$ Resources:Labels, LastName %>"
then there is no parsing error, the field with its value shows, but with the Last name caption, which is obviously not what I want.

What is the point of creating a new Profile Type if I have to add the fields to the basic profile?
 
I have created a Profile type for our affiliate and want use the profile widget to display the fields. Is that possible? So far, it works, but without the captions(Title). How do I get the <Title> to work.

Posted by Community Admin on 21-Mar-2012 00:00

Hi,

The Title should contains resources that have already been added. If you want to use:

Title="<%$ Resources:Labels, Address1 %>"
you have to create a label with resource key. Please follow these steps: Go to Administration -> Interface Labels and Messages -> Create Label -> Label: Address1 -> Description:Something -> Key:Address1 -> Type:Labels -> Save changes.
Go to your Sitefinity project in Visual Studio. Restart your web.config. Build the solution.

The point of creating a new Profile Type is that for example if you have a profile in one web site with forum, you have a user name. And if you want to use another user name in this forum you have to create a new profile type and add fields on it. So you will have a profile for the backend of the Sitefinity and another profile with different information in the forum. To add a new profile type follow the steps bellow:
1. Go to Administration->Users.
2. Select Menage profile types.
3. Create profile type.
4. Give a title to your profile type, add fields and save the changes.
5. Go back to Administration->Users.
6. Select Admin.
7. Extend the profile type you have created.
8. Give some text to this/these field(s).

After you have created a profile type with fields go to the page which used profile widget. Select Edit, choose Profile Type(select the type you have created), in  'Read mode' template choose Auto-generated, Click Edit template and add your field somewhere in the asp:PlaceHolder, save the changes, publish and view your page.
 





All the best,
Stefani Tacheva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 21-Mar-2012 00:00

Adding the label did the trick. Thank you very much.

I've already created a new profile type so that is not an issue.

What I would suggest is to create the label automatically when we add fields to a profile type. In the field setting, there is an area for Label, and I was expecting this to be used for the label automatically in the profile widget.

Posted by Community Admin on 21-Mar-2012 00:00

Hello,

Thank you for the suggestion, we will discuss it on the next team meeting!

Kind regards,
Stefani Tacheva
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed