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

Forums / Bugs & Issues / Signup for Newsletter - Widget?

Signup for Newsletter - Widget?

6 posts, 0 answered
  1. Scott
    Scott  avatar
    12 posts
    Registered:
    20 Apr 2011
    12 Aug 2011
    Link to this post
    I need to only collect the 'email' of a potential user (not the first name or last name) is there a way to remove these fields from the Widget? I looked for it in the Widget Templates but did not see any related.

    thanks
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    28 Aug 2017
    15 Aug 2011
    Link to this post
    Hi Scott ,

    It' s not a problem to modify the template for the SubscribeForm widget, and comment out the FirstName and LastName textboxes - please find the default template we're using below:
    <%@ Control Language="C#" %>
    <%@ 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">
                <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>
    once you've created your custom template you can map it globally by going to Administration->Settings->Advanced->Controls->ViewMap and create new. For HostType, please specify:
    Telerik.Sitefinity.Modules.Newsletters.Web.UI.Public.SubscribeForm
    and in the LayoutTemplatePath field, fill in the application-relative path to your custom template. Save the changes and restart the application, and you should have the new template applied globally throughout your site.

    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. Scott
    Scott  avatar
    12 posts
    Registered:
    20 Apr 2011
    15 Aug 2011
    Link to this post
    Thanks..

    A couple of questions.

    1.) What is the file extension for the template?
    2.) What directory do I save the template in?
    3.) We are about to upgrade to 4.2, is the template available in 4.2?

    Thanks.
  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    28 Aug 2017
    15 Aug 2011
    Link to this post
    Hi Scott ,

    1) *.ascx
    2) It doesn't really matter, as long as you provide the proper relative path to the template when mapping it.For the sake of convenience I'd advise you to place it in a ~/ControlTemplates folder
    3) Yes, the default template was taken from the 4.2 CodeBase

    P.S. You can create a totally different SubscribeForm using our Forms module, and then connet it to a mailing list using the "Connect this list" option when creating a new mailing list.


    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
  5. Scott
    Scott  avatar
    12 posts
    Registered:
    20 Apr 2011
    15 Aug 2011
    Link to this post
    Thanks for the quick reply:

    How about this: I went to the Widgets Template / Created a new Template - pasted your code in it and save it as 'Newsletter Subscription', however for the "This Template is applied to..." I did not see a newsletter item, what should I apply it too?

  6. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    28 Aug 2017
    16 Aug 2011
    Link to this post
    Hello Scott ,

    Please excuse me if my previous response has been ambiguous. I was referring to mapping an external template (created through Visual Studio).

    All the best,
    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
6 posts, 0 answered