CHAPTER 5 Taking It to the Next Level with SharePoint Designer


Advertisement

You can do a lot to customize SharePoint online using just the web user interface (UI). But you inevitably run  into the limitations when using  just a web browser. To overcome these limitations, you need to move  up to using SharePoint Designer (SPD) 2010. Development done in SPD is frequently called customization rather than development because the edits  you make will be made using  declarative statements instead of server-side compiled managed code  assemblies. That’s why development in SPD is frequently referred to as no-code development (even though you can still write code  using  HTML, XML, or client-side script).


This chapter takes a detailed look at how to use SPD as a development tool for customizing SharePoint Online. With SPD 2010, you can move  beyond the basic  customizations available in the UI to rapidly developing rich custom applications.


Okay, let’s get started. In this chapter, we will cover the following topics:

 

•   Using SPD to administer a SharePoint site

 

•   Enhancing the display of data by customizing the XSLT List View or Data Form Web Parts

 

•   Accessing external data using  Business Connectivity Services  (BCS)

 

•   Customizing the look and  feel of a SharePoint site

 

•   Using SPD 2010

 

•   Creating custom code  with Visual Studio 2010

 

Getting Started With SharePoint Designer 2010

 

One of the real advantages of using  SPD 2010 as a development environment is that it’s available as a free download from Microsoft. You can download either a 32-bit  or 64-bit  edition depending on your existing installation of Office 2010. If you haven’t downloaded and  installed SPD yet, you should do so before proceeding with this chapter. You can get it from these sources:

 

•  SPD 2010 32-bit: http://www.microsoft.com/download/en/details.aspx?id=16573

 

•  SPD 2010 64-bit: http://www.microsoft.com/download/en/details.aspx?id=24309

 

Note  Although  SPD 2007 can’t be used to edit Office 365 SharePoint Online sites, SPD 2010  can be used to customize either on-premise or online SharePoint installations.

 

If you install SPD and  still can’t open your site, keep reading. The use of SPD might be disabled in your site collection. Controlling the use of SPD in your site collection is explained more fully in the next section.

 

Controlling the Use of SPD 2010

One of the first things you need to do after installing SPD 2010 is to decide what  users can do with it. By default, the use of SPD in SharePoint Online is very limited for anyone other than site collection administrators. Members of the Site Owners group or users with the Add and  Customize Pages permission can open a site. But they can’t edit a master page,  create a publishing page layout, view files that are hidden in the UI, or apply  any customizations that aren’t allowed using the UI. In other words, by default most users can’t do anything with SPD that can’t already be done in other ways. If you want  to use SPD to customize your online site, you need to either be a site collection administrator or enable the full use of SPD through the SharePoint Designer Settings page shown in Figure  5-1. This page can be reached from a link in the Site Collection Administration section of the Site Settings page and  is only available to site collection administrators.

 

Note Turning on the publishing features in your site collection will change the default settings and automatically enable all four options.

 

 

Figure 5-1. SPD Settings page in Site Settings

 

There are four settings available on the SharePoint Designer Settings page.  Let’s take a look at these options in order:

 

• Enable SharePoint Designer: This option controls whether sites in this site collection can be opened in SPD or not. Unless this option is enabled, none of the other options matter. Attempting to open a site when this option is disabled will display the error message shown in Figure  5-2.

 

\

Figure 5-2. Error displayed when opening a site in which SPD use is disabled

 

•  Enable Detaching Pages from the Site Definition: Disabling this option will prevent users from performing actions that would effectively  cause the page to become customized. If you are familiar with SPD 2007, you know that any time you made a change to a page using  SPD, it would create a new version of the page and  place  it in the content database of that site, thereby causing the page to become a customized page.  It would no longer reference the definition page located in the file system on the SharePoint Server.

 

• Enable Customizing Master Pages and Page Layouts: If this check box is disabled, users will not see the Master Pages or Page Layouts site object categories.

 

•   Enable Managing of the Web Site URL Structure: Disabling this option will hide the All Files and  Sub Sites site objects, keeping users from opening pages or subsites directly from the URL hierarchy of the site. Only pages stored in document libraries will be available for editing.

 

Administering a SharePoint Site

Not everything you do with SPD 2010 is development. Many development efforts  start with the creation of new sites or lists. Most of these sites or lists are unique and  need to be created only once, so it might be easiest to create these in either the UI or using SPD. But even if you are working to create a site or list that will be reproduced in many places, you can often save time  by prototyping the site using  SPD and then transferring the completed design template to be deployed as a sandboxed solution. SPD provides an excellent tool for this kind of early prototyping development.

 

Note  Chapter 7 provides more coverage of sandboxed solutions.

 

Building New Websites

Because of its multitenant-based design, new SharePoint Online site collections can’t be created using SPD 2010. They must be created in the SharePoint Online administration center, as pictured in Figure  5-3.

 

Note  The Office 365 Small Business and Professional plans support only one public and one private site collection.

 

 

Figure 5-3. Creating  site collections in the SharePoint Online Administration Center

 

But creating a new subsite using SPD is relatively easy. You’ll be asked what  template you want  to use and  where in the hierarchy of your site collection you want  to place  it. You can use either one of the default site templates or a custom template you created by saving a site as a template or deploying a site template using  a sandboxed solution. Remember, just like an on-premise installation of SharePoint, you can’t change the site template of a site after it is created, so make sure  you know what  kind of subsite you want  before you create it.

 

EXERCISE 5-1. CREATING A SHAREPOINT SUBSITE

 

In this exercise, we’ll create a standard team site called “SPD Demo” that we will use to host practice exercises for the rest of this chapter.

 

1.   Open the top-level  site of your SharePoint Online private site collection  in SPD. If you're not sure how to do this, review the steps in Chapter 3 on “Connecting SharePoint Designer to SharePoint.”

 


Advertisement

2.   With the {site collection name} Site Object selected in the sidebar, you should see a page similar to the one in Figure 5-4. Click New in the Subsites section of the page.