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

Forums / Developing with Sitefinity / Need default code for profile widget templates - 8.2

Need default code for profile widget templates - 8.2

2 posts, 0 answered
  1. Scott Rozman
    Scott Rozman avatar
    93 posts
    Registered:
    10 Oct 2012
    05 Nov 2015
    Link to this post

    I was trying out some custom fields on the user profile and then the ability to create a custom profile as well.

    I discovered that new custom fields would need to be added to my "article-like" widget template for the profile. Once I tried to save some changes to that widget template, it is no longer a choice in the dropdown on the widget and no way to restore that widget template to the original and is not among those which can be edited under the design menu.

    I imagine that I can restore this by creating a new one with the same "programming name" but a bit hard to do this when it does not show up and is not among the widget code items when you download resources through the SDK.

    Anyone know where to get a copy of this code, short of creating a new project?

    Also more of a rhetorical question... why would only certain items be available under Design -> Widget templates.

    To be clear, I am working with the traditional widgets, not MVC. Even though some MVC equivalents exist for these, they are not styled, so would be more difficult to implement vs. tweaking some styles on something which already has a decent layout.

    Thanks for any insights,

    Scott

  2. Arnob Makhlaqur
    Arnob Makhlaqur avatar
    41 posts
    Registered:
    23 Sep 2016
    17 Nov 2015
    Link to this post
    Hi Scott,

    The UserProfileView settings need to be checked whether all the field value matches with attached settings image (UserProfileViewSettings.JPG) : Toolboxes->Toolboxes->PageControls->Sections->Users->Tools->UserProfileView.

    The default 'Article-like' Template is found only if  1. This profile is in... Read mode only or Both: Read mode that can be edited is selected.

    As it is mentioned that the "Article-like" template is no longer a choice/ missing from the drop-down list then it can be created by clicking on Create New Template button and write the Template Name: Article-like and insert the following code into the text area above the Template Name field:
    <%@ 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">
                <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="email" runat="server" DataFieldName="sf_Email" DisplayMode="Read" Title="<%$ Resources:Labels, Email %>" CssClass="sfprofileEmail" />
            </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" />
            <asp:HyperLink runat="server" ID="changeQuestionAndAnswer" Text="<%$ Resources:Labels, ChangeQuestionAndAnswer %>" CssClass="sfprofileChangePasswordLnk" />
        </div>
    </div>

    This code can be generate by creating a new SF project and drop the Profile widget on a page and then Edit-->select Read mode only-->choose Article-alike from the Template drop-down list-->Click on Edit Template (this code can be restore to it's default value by clicking on the Restore template to default button at the top right side)


    As mentioned in our documentation of Widget templates there are Widget Templates of built-in Sitefinity widgets – Blog posts, News, Events, Generic content, Images, Videos, etc. And MVC Widget Templates are not showing in the Widget Template page as these can be editable in the file system. 

    The following Blog can be useful to customize/ add custom field controls to the UserProfile Widget Edit Mode Templates: http://www.sitefinity.com/blogs/boyan-barnevs-blog-/2014/11/26/how-to-customize-the-userprofile-widget-templates.


    Regards,
    Arnob Makhlaqur
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered