Signup for Newsletter - Widget?
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
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
>
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.
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
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?
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