More in this section

Forums / Bugs & Issues / 4.1 Newsletter Widget

4.1 Newsletter Widget

4 posts, 0 answered
  1. Scott
    Scott  avatar
    12 posts
    Registered:
    20 Apr 2011
    17 May 2011
    Link to this post
    Where or how can I make edits to the Newsletter Widget? I only want an 'email' field displayed in the widget. I tried looking under the 'widget templates' but find nothing.

    Thanks
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    30 Oct 2017
    19 May 2011
    Link to this post
    Hi Scott ,

    You can map the template for the SubscribeForm from the LayoutTemplatePath property of the widget (please see the attached screenshot). Please find below the default template we're using and the corrections I've done to it which hide the desired fields.
    <%@ Register TagPrefix="sitefinity" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
     
     
    <fieldset id="formFieldset" runat="server" class="sfnewsletterForm sfSubscribe">
        <sitefinity:SitefinityLabel id="widgetTitle" runat="server" WrapperTagName="h2" HideIfNoText="true" CssClass="sfnewsletterTitle" />
        <sitefinity:SitefinityLabel id="widgetDescription" runat="server" WrapperTagName="p" HideIfNoText="true" CssClass="sfnewsletterDescription" />
        <sitefinity:Message ID="messageControl" runat="server" FadeDuration="3000" />
        <ol class="sfnewsletterFieldsList">
            <li class="sfnewsletterField">
                <asp:Label ID="emailAddressLabel" runat="server" Text='<%$Resources:NewslettersResources, EmailAddress %>' AssociatedControlID="emailAddress" CssClass="sfTxtLbl" />
                <asp:TextBox ID="emailAddress" runat="server" CssClass="sfTxt" />
                <asp:RequiredFieldValidator ID="emailValidator" runat="server" ControlToValidate="emailAddress" ValidationGroup="subscribeForm" CssClass="sfErrorWrp" Display="Dynamic">
                    <strong class="sfError"><asp:Literal runat="server" ID="lEmailIsRequired" Text='<%$Resources:NewslettersResources, EmailIsRequired %>' /></strong>
                </asp:RequiredFieldValidator>
            </li>
            <li class="sfnewsletterField" style="display:none">
                <asp:Label ID="firstNameLabel" runat="server" Text='<%$Resources:NewslettersResources, FirstNamePublicForm %>' AssociatedControlID="firstName" CssClass="sfTxtLbl" />
                <asp:TextBox ID="firstName" runat="server" CssClass="sfTxt" />
            </li>
            <li class="sfnewsletterField" style="display:none">
                <asp:Label ID="lastNameLabel" runat="server" Text='<%$Resources:NewslettersResources, LastNamePublicForm %>' AssociatedControlID="lastName" CssClass="sfTxtLbl" />
                <asp:TextBox ID="lastName" runat="server" CssClass="sfTxt" />
            </li>
        </ol>
        <div class="sfnewsletterSubmitBtnWrp">
            <asp:Button ID="subscribeButton" runat="server" Text='<%$Resources:NewslettersResources, SubscribeToList %>' ValidationGroup="subscribeForm" CssClass="sfnewsletterSubmitBtn" />
        </div>
    </fieldset>
     
    <asp:Panel ID="selectListInstructionPanel" runat="server">
        <asp:Literal ID="pleaseSelectList" runat="server" Text='<%$Resources:NewslettersResources, ClickEditAndSelectList %>' />
    </asp:Panel>
    I'm also attaching a copy of the template for your reference, you can plug it into your project. I hope you find this information useful. If any additional questions arise, please let us know.

    Kind regards,
    Boyan Barnev
    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
  3. Richard
    Richard avatar
    164 posts
    Registered:
    21 Nov 2009
    29 Aug 2011
    Link to this post
    Hi

    Can anyone help me with regard 'how to plug this in to my project' - I've tried most ideas I've found in the documentation and on the forums, and still nothing working... I can't even find where the original SuscribeForm resides within the Toolboxes... There doesn't seem to be an 'Email Campaigns' section in the Toolbox list for Page Controls... Any help much appreciated.

    Thanks

    Cheers
    Richard
  4. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    31 Aug 2011
    Link to this post
    Hello Richard,

    The original subscribe form code can be found in the source of Sitefinity. You can also download our SDK where you can find an extended template of the subscribe form - in near future we will try to include all control templates in the SDK. However if you want to modify the original template, please refer to the code bellow:

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sitefinity" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
     
    <asp:Panel ID="errorsPanel" runat="server" CssClass="sfErrorSummary" Visible="false" />
    <fieldset id="formFieldset" runat="server" class="sfnewsletterForm sfSubscribe">
        <sitefinity:SitefinityLabel id="widgetTitle" runat="server" WrapperTagName="h2" HideIfNoText="true" CssClass="sfnewsletterTitle" />
        <sitefinity:SitefinityLabel id="widgetDescription" runat="server" WrapperTagName="p" HideIfNoText="true" CssClass="sfnewsletterDescription" />
        <sitefinity:Message ID="messageControl" runat="server" FadeDuration="3000" />
        <ol class="sfnewsletterFieldsList">
            <li class="sfnewsletterField">
                <asp:Label ID="emailAddressLabel" runat="server" Text='<%$Resources:NewslettersResources, EmailAddress %>' AssociatedControlID="emailAddress" CssClass="sfTxtLbl" />
                <asp:TextBox ID="emailAddress" runat="server" CssClass="sfTxt" />
                <asp:RequiredFieldValidator ID="emailValidator" runat="server" ControlToValidate="emailAddress" ValidationGroup="subscribeForm" CssClass="sfErrorWrp" Display="Dynamic">
                    <strong class="sfError"><asp:Literal runat="server" ID="lEmailIsRequired" Text='<%$Resources:NewslettersResources, EmailIsRequired %>' /></strong>
                </asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator
                    ID="emailRegExp"
                    runat="server"
                    ControlToValidate="emailAddress"
                    ValidationGroup="subscribeForm"
                    ValidationExpression="[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,4}"
                    Display="Dynamic"
                    CssClass="sfErrorWrp"
                    ErrorMessage="<%$ Resources:ErrorMessages, EmailAddressViolationMessage %>">
                        <strong class="sfError"><asp:Literal ID="lEmailNotValid" runat="server" Text="<%$ Resources:ErrorMessages, EmailAddressViolationMessage %>" /></strong>
                </asp:RegularExpressionValidator>
            </li>
            <li class="sfnewsletterField">
                <asp:Label ID="firstNameLabel" runat="server" Text='<%$Resources:NewslettersResources, FirstNamePublicForm %>' AssociatedControlID="firstName" CssClass="sfTxtLbl" />
                <asp:TextBox ID="firstName" runat="server" CssClass="sfTxt" />
            </li>
            <li class="sfnewsletterField">
                <asp:Label ID="lastNameLabel" runat="server" Text='<%$Resources:NewslettersResources, LastNamePublicForm %>' AssociatedControlID="lastName" CssClass="sfTxtLbl" />
                <asp:TextBox ID="lastName" runat="server" CssClass="sfTxt" />
            </li>
        </ol>
        <div class="sfnewsletterSubmitBtnWrp">
            <asp:Button ID="subscribeButton" runat="server" Text='<%$Resources:NewslettersResources, SubscribeToList %>' ValidationGroup="subscribeForm" CssClass="sfnewsletterSubmitBtn" />
        </div>
    </fieldset>
     
    <asp:Panel ID="selectListInstructionPanel" runat="server">
        <asp:Literal ID="pleaseSelectList" runat="server" Text='<%$Resources:NewslettersResources, ClickEditAndSelectList %>' />
    </asp:Panel>


    All the best,
    Victor Velev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

4 posts, 0 answered