Creating and Modifying Web Pages in Microsoft SharePoint Designer 2010

  • 12/23/2010

Creating List View Pages

The built-in list views that are associated with a list or library might not meet all your needs. In the browser, you can use the sort and filter option on a column of a list view, but this is only a temporary solution because the next time you use the list or library, your sort or filter selections are not applied. By using both the browser and SharePoint Designer, however, you can create new list views and retain your selections. In addition, when you create list views, other formatting options become available, such as the order and visibility of columns, grouping list items in an expanded or collapsed display, or limiting the number of list items displayed.

In this exercise, you create a view for a library to display documents grouped by the person who last modified them and sorted on the modification date and file size. You then make this view the default view.

  1. In the Navigation pane, click Lists and Libraries, and then under Document Libraries, click Shared Documents.

    The Shared Documents list settings page is displayed in the workspace.

  2. httpatomoreillycomsourcemspimages1806271.jpg On the List Settings tab, click List View in the New group.

    The Create New List View dialog box opens.

  3. In the Name box, type ByModified.

    httpatomoreillycomsourcemspimages1806273.jpg

    The name that you type for the view page forms part of the URL.

  4. Click OK to close the New List View dialog box.

    The ByModified view appears in the Views area.

  5. Right-click ByModified, click Rename, and then type By Modified. Press ENTER.

    By Modified is the name of the view you will see in the browser.

  6. Click By Modified to open the page in edit mode.

    The workspace tab is labeled ByModified.aspx. A blue border with the label Main appears, within which is the label <webpartpages:XsltListViewWebPart>. This indicates that an XLV Web Part is contained within the Web Part zone Main. A purple-bordered rectangle surrounds the Web Part zones, labeled PlaceHolderMain (Custom). The ribbon contains the List View Tools tabs.

  7. httpatomoreillycomsourcemspimages1806275.jpg On the Options tab, click Sort & Group in the Filter, Sort & Group group.

    The Sort And Group dialog box opens.

  8. Under Available fields, click Modified By, and then click Add.

  9. Repeat step 8 to add Modified and File Size.

  10. Under Sort order, click Modified By. Then, in the Group Properties section, select the Show group header check box and click Expand group by default if this option is not already selected.

  11. Click Modified. In the Sort Properties section, click Descending.

    httpatomoreillycomsourcemspimages1806277.jpg
  12. httpatomoreillycomsourcemspimages1806059.jpg Click OK to close the Sort and Group dialog box. On the Quick Access Toolbar, click Save, and then in the breadcrumb, click Shared Documents to open the list settings page.

  13. httpatomoreillycomsourcemspimages1806279.jpg In the Views area, click the icon to the left of By Modified to display the Views tab on the ribbon, and then click Set as Default in the Actions group.

    In the Views area, in the Default column, Yes is removed from the All Documents row and appears in the By Modified row.

  14. httpatomoreillycomsourcemspimages1806049.jpg Close the ByModified.aspx tab by clicking the Close icon at the top right of the workspace.

    The site settings page is displayed in the workspace.