Creating mailing lists for SharePoint sites and blogs [No Code Required] – Part 2: Creating a custom subscription form

NOTE : This article was published on EndUserSharePoint.com a couple of weeks ago and because of the wonderful feedback I received, I decided to cross-post it here too.

This is the second article in a multipart series that is intended to help you create mailing lists for your SharePoint sites or blogs without writing a single line of .NET Code. In the introductory article, I listed the project initiatives, requirements, and objectives. In Part 1, I created a secured backend where we store the subscribers’ contacts. In this article, we will continue our journey, let’s carry on!

In the previous article, I made use of the ‘Contacts list template, provided out-of-the-box by SharePoint, to create a list which will act as the backend for our mailing list. In this article, I will show you how to configure the ‘Contact’ content type, create a custom subscription form and do some sort of customization. The intention of these customizations is not only to make the subscription form look different from the out-of-the-box list forms but also to show you the power, simplicity, and efficiency of SharePoint Designer 2007.

  1. Navigate to the list settings page > Advanced settings.

69

2. Make sure that management of content types is turned on

70

3. Navigate to the contact content type settings page from the list settings as shown underneath:

71

4. Configure the content type fields from the content type settings page. We need a  list subscriber to mandatorily supply their first namelast name and e-mail address and optionally supply theirCompanyCity and Country.

72

73

5. Now, navigate to the New Form (NewForm.aspx) by adding a new contact to the list as follows :

74

75

6.As shown in the figure above we need to get rid of the highlighted areas. I will show you in this article, and the next one how, to accomplish that.

7. Open up SharePoint Designer, connect to your SharePoint site collection, and supply your credentials.

8.Choose the list that we created in the previous article from the folder list. If the Folder List is not visible, on the View menu, click Folder List.

9.Make a copy from the NewForm.aspx and rename the copied version from NewForm_copy(1).aspx to subscribe.aspx as follows:

76

77

78

10. Change the list New item form from NewForm.aspx to subscribe.aspx using the supporting files tab of the list properties’ dialogue box as illustrated below:

80

81

82

11.Now choosing to add a new contact to the list will redirect you to subscribe.aspx rather than NewForm.aspx.

12.Our next task is to modify the newly created form (subscribe.aspx) to look like a mailing list subscription form rather than the traditional SharePoint list forms.

13.Open subscribe.aspx using SharePoint designer.

14.Select “New Item” highlighted in the figure below. Delete it with the colon preceding it.

83

15.    Now, we need to eliminate the “New Item” from the form breadcrumb.

15.1. Select the “PlaceHolderTitleBreadcrumb” placeholder from the Master Page toolbar as shown in the figure below.

84

 

Note:  You can show this toolbar if it is hidden from View menu > Toolbars.

15.2. The word (Master) on the content placeholder tab means that the content is retrieved from the master page. To make this content region editable to override the retrieved data, click the arrow in the upper-right corner to show the Common Content Tasks list, and then click Create Custom Content as shown in the figure below. This will automatically create a new content region that will fill the placeholder in this page rather than using the Master’s default content.

85

 

15.3. Replace the SiteMapPath control with a link to the site collection’s welcome page. You can use the handy “SPLinkButton” control in conjunction with “ProjectProperty” control to accomplish that as shown below. The  good thing about SPLinkButton is that it is aware of ~site and ~sitecollection expression tokens.

 

1

2

 

16. To change the page title “IE Tab title”, locate the ”PlaceHolderPageTitle” placeholder using the Master Page toolbar discussed above and replace the ListFormPageTitle control with your own title.

3

 

4

 

17 . Now, we are in a good shape; only one non-compulsory step is left which is adding the left navigation bar back to the page. Note the word (Custom) on the content placeholder tab. This means that the content is custom content for this page only, and that it is not retrieved from the attached master page. Nevertheless, we do not need any custom content for this page. We need to retrieve the left navigation menu from the master page so the only thing we need to do is defaulting the region to the master’s content using the Common Content Tasks as shown in the figure below.

5

 

18.  Save your changes by clicking Save on the File menu. A message appears warning you that saving your changes will customize a page from the site definition. Click Yes.

6

 

19. And here is what you will end up with, if you follow the preceding steps.

7

 

Note: If you are not pleased with the customizations that you have made to the page, you can always reset it to the site definition.

Summary:

In this article, I showed you how to configure the ‘Contact’ list content type, create a subscription form for the mailing list, make it the default New Item Form and do some simple customizations to it.

In the next article, I will show you how to customize the form fields, use the extremely powerful DataFormWebPart, change the form validation mechanism to be client sided, add your own validation logic, configure the SPDataSource control and much more ..

About EndUserSharePoint:

EndUserSharePoint.com is a community of SharePoint authors dedicated to providing content to SharePoint End Users on three levels: Information Worker, Power User/Site Administrator and Site Collection Administrator.

Advertisements

One thought on “Creating mailing lists for SharePoint sites and blogs [No Code Required] – Part 2: Creating a custom subscription form”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s