Web Content Management


The web content management features for SharePoint Portal Server 2003 were close to nonexistent; it had support for approval, but that's about it. This required content editors for the intranet, extranet, or public Internet site to edit, test, and get the approval of new content on a server other than the production SPS 2003 server. This was clearly not the ideal way to work with web-based content for an organization with high standards. This lack of content management features in SPS 2003 was at the same time a great business opportunity for other vendors, who developed smart add-on products that enhanced the content management features of SPS. Of course, Microsoft was aware of this shortcoming in SPS 2003, and one of their suggested solutions to this was that customers should use their product MS Content Management Server (MS CMS), which had all the standard content management features asked for. There was, to some extent, an integration of the two (for example, content in SPS 2003 could be presented to the MS CSM web site), but they still worked in very different ways, and it was difficult for the IT department to manage both of these products.

With the release of MS Office SharePoint Server 2007, or MOSS, Microsoft has actually integrated the MS CMS product into MOSS, plus added a lot of new features, such as support for workflows. The result is a very advanced but easy-to-use web content management system. Note that this is only true for MOSS 2007. If you choose to go with WSS 3.0 alone, you will not get these content management features. The web content management features are integrated in some (but not all) of the site templates that MOSS comes with; these types of web pages are known as Publishing Pages.

Web Content Management in MOSS 2007

As described earlier in this chapter, managing a web site for an intranet or a public Internet site requires more than managing a team web site; the difference is the type and the number of consumers (or audience). If you make a simple mistake on your team site where everyone knows you, then it is embarrassing at most, but if you make a mistake that the world can see, it may be a disaster. So, the need for control is higher for a public web site, including intranet and extranet sites, and this is exactly what you get with MOSS 2007.

Let's see how a web page with support for web content management looks in MOSS 2007. Say that you have created a site based on the MOSS site template Collaboration Portal (which is the typical site template for an intranet, as described in Chapter 6). If you click Site Actions image from book Edit Page, you will see something similar to Figure 9-1.

image from book
Figure 9-1

A lot of things happened when switching this page to edit mode. Let's analyze it in more detail. Notice the toolbar at the top of this web page; this is typical for a publishing web page with web content management features. At the top of the toolbar appears "Version: Checked Out. Status: Only you can see and modify this page. Publication Start Date: Immediately." In other words, just because you're starting to edit this web page, it was automatically checked out to you, and it is also clear that no one other than you can see the modifications you will make now. It is also clear from this instruction that there is no scheduled publication date, so as soon as this web page is published, its modified content will be immediately visible to all consumers (users).

Depending on the permission you have, you may be able to publish the modified page directly. Since SharePoint 2007 is security-trimmed (only actions you are allowed to make are visible), you can look for the Publish button in the toolbar; if you can see it, then you are allowed to publish your own modifications. In Figure 9-1 this button is visible, so the current user obviously has the necessary permission to publish content. If not, you have two options: Either check it in or submit it for approval. So, the three buttons available to save the modified web page are:

  • q Publish: Click this button to publish the modified page.

  • q Check in to Share Draft: Click this button if you want to check in the page and possibly give other web authors the opportunity to continue editing the page.

  • q Submit for Approval: Click this button if you are done editing this page and you want another user, for example your manager, to approve the new content and make it public.

There are also several menus, with a lot of options that are described later in this chapter. But where is the web page stored? And is the information shown here just one web page? The answer is no! The content of the page (the text, images and Web Parts) is stored in something called a page file. Look at the URL for this page to see the name of this page file; for example, http://srv1/pages/default.aspx says that this page file is named "default.aspx", and it is stored in something called "pages." The other file is describing the "chrome lists" for this page (the layout and colors for the Quick Launch bar at the left of this page, including the menus, links and the logotype at the top, which are stored in a separate Master Page file that you will learn more about in Chapter 13).

To see exactly where this Default.aspx page is stored, first exit editing mode. If you did not make any modifications, you can discard the checkout information that was automatically generated when you started editing this page.

  1. Click the Page menu and then Discard this Check Out. The content management system will now ask you "Do you want to discard this checked-out version?" Click Yes. The web page should now look like it did before.

  2. Click the link View All Site Content at the top of the Quick Launch bar; this will display all the lists for this particular publishing site. Note that there is a document library named "Pages," which corresponds to the URL for this page.

  3. Click on the name Pages to show all the files in this library. You should now see the Default.aspx file listed (see Figure 9-2). Note that the column shows if this page is approved (i.e., published) or not, who made the last modification, if it is checked out, if it has scheduled publishing start and stop dates, and what type of page layout it is built on.

image from book
Figure 9-2

If you open the quick menu for this file (click to the immediate right of the filename), you will see a lot of options. Note that some of these will only show up under specific conditions; for example, the option to unpublish a version is only visible when the current page file is published.

  • q View Properties: Display all the properties for the web page, including any page images and content, but not Web Parts. You can also see what version it is, when it was initially created, and by whom, and if it is targeted for a specific audience. This property page also lists a number of actions you can take on the web page; for example to edit or delete it, manage its permissions, check its version history, create an alert for this web page, approve any pending modification, and initiate a workflow.

  • q Edit Properties: This option is similar to the View Properties option, except that it will allow you to edit parts of the content for the web page, and all its metadata. When you select this option, you must first accept the option to check out the page. Note that there is only a limited set of actions available, such as delete the page, check the spelling, or click OK to save any modification (or click Cancel). Whether you click OK or Cancel, this page will still be checked out, and you must do a checkin, and then click Approve to make it public again.

    Important 

    If you want to leave editing mode without saving anything, click Cancel, and then select Discard Check Out from the page file's quick menu.

  • q Manage Permissions: This option allows you to configure a specific permission for the page file. By default, it will follow the usual way permission inheritance works in SharePoint 2007; that is, this file inherits the permission set on its library, which in turn inherits from the web site. To actually break the inheritance, click Actions image from book Edit Permissions, and make whatever changes to the permission settings necessary.

  • q Edit in Microsoft Office SharePoint Designer: This will allow you to edit the actual page layout, not the content in itself. When selecting this option, you must again accept the option to check out the page file. When SharePoint Designer then starts, it will inform you that you can choose between Edit in Browser, Edit Page Layout, or Cancel. If you select Edit in Browser, then SharePoint Designer will still run, and you scan edit the page in a web browser. If you instead select Edit Page Layout, you will actually open the underlying layout file for this page - and that file will also require you to do a checkout before editing (or select No if you just want to see the content of the Master Page).

  • q Delete: Choose this option to delete this web page file.

  • q Send To: This options allows you to do one of these things: e-mail a link to this page file; Create Document Workspace, which will create a separate web site, and make a copy of the page file in that site (see more about this feature in the end of this chapter); or Download a Copy. The administrator can also create more links to this Send To list.

  • q Check Out: (or Check In, depending on the current status for the page file). This is automatically performed when you select the option to edit the page file.

  • q Publish a Major Version: This options is only available if the current page file is in draft mode. Use this option to make it a major version (i.e., going from the draft 7.1 to 8.0), but remember that this page must be approved before it gets published.

  • q Unpublish this version: This option is only available when the page file is published. Choose this option if you want to unpublish the current version of this page file. Since this will affect what all users are seeing, a dialog box shows up and asks "Are you sure you want to unpublish this version of the document?" Click OK if you do. The effect is that the page file is converted to a draft, and the last published page is what users will see. For example, if the current published version of the page file is 8.0, and you choose to unpublish it, then it is converted to draft version 7.1, and the version that all users will see is 7.0, since it was the last published version. This type of action can be a real lifesaver if a draft gets approved and published by mistake, and you quickly want to go back to the draft version and continue to modify it.

  • q Version History: This option will show a list of all the versions of the page file. It shows when these versions were saved, and by whom, including their size. It will also show what has been modified; for example, page images and page content, (except Web Part content). Each listed version also has a menu (click to the right of the version date) that lists three actions: View (open the page in a web browser), Restore (make this the current major version - for example, if the current version is 8.0 and you select Restore for version 6.0, then 6.0 becomes version 9.0, and 8.0 becomes an old version). The third action listed on the menu is Delete, which removes the version (or really moves it to the Recycle Bin for the site).

  • q Workflows: Allows you to start any workflow associated with the document library. By default, there are no workflows for the Pages library, but you could create one with SharePoint Designer; see more about this in Chapter 13.

  • q Alert me: Use this option to create a subscription for the page file; for example, if the file is modified by another content author, then SharePoint will send an e-mail to you. See more about this feature earlier in this chapter.

To summarize, the web page displayed on this intranet site is a Publishing Page file named Default.aspx, which is stored in a document library named Pages. The layout of the content is defined in a page layout file, and the top menus and Quick Launch bar around the content are defined in a Master Page file. If you have the proper permissions, you can check out the content page file, and modify it. To make the updated version visible to others, you must first publish a major version of that page file and then approve it. There are a lot of actions you can perform on the page file, such as displaying its properties, viewing its version history, and starting workflows. In other words, there are one or two things you need to know before building your intranet, but it is not rocket science.

Editing Web Page Content

The next question is how do you modify the actual page content? Again let's take the home page of the Collaboration Portal intranet site as an example. Open that home page, then click Site Actions image from book Edit Page to switch the page to edit mode (see Figure 9-1). By default, this page layout has two page content parts and five Web Part zones:

  • q Page Image: This part allows you to display an image. The position is defined by the layout file for this page.

  • q Page Content: This part allows you to enter HTML formatted text, including pictures and tables. Its position and layout are also defined by the layout file for this page.

  • q Web Part Zones: These are the Right Zone, Top Zone, Middle Right Zone, Middle Left Zone and Bottom Zone. Add any type of Web Part to any of these zones. Their position is defined by the layout file for this page.

Later in this chapter you will learn how to edit the layout file, but for now let's see how its content can be modified. To start with, you want to change the image, but before you can do that you should upload some images to the image library of this site, then you can change the image on this home page:

Try It Out Modify the Page Image Control

image from book
  1. All images that will be displayed on any SharePoint web page must reside in a location that all users can read, regardless of where they are located. The smartest place to store them is in an image library in SharePoint itself. By default, you have two image libraries on the Home site of the intranet portal, but you can also create new image libraries when needed. To add one or more image files to the library named Images, do this:

    1. Open the Home page for the intranet, then click View All Site Content. Note that it does not matter if your home page is in edit mode!

    2. Click Images. By default, you will only find one single image in a newly installed MOSS server, with the name NewsArticleImage.

    3. To upload some more image files to this library, click Upload, and then either click Browse, to upload a single image, or click Upload Multiple Files to display an Explorer view of your file system. Choose whichever method you want, select at least one image file, then click OK, and then OK again, to upload it.

    4. The new image file is now copied to the library. However, this is configured to do automatic checkout, so before you can use the image file, you must click Check In (see Figure 9-3).

      image from book
      Figure 9-3

    5. Next, you must approve it by opening the quick menu for the new file and selecting Publish a Major Version, then click OK.

    6. Finally use the quick menu again, select Approve/reject, select Approved, then click OK. Yes, I agree - it was a lot of steps, but this is the price you have to pay for the control that content management gives you. Okay, let's go on. Now, you should see the new image next to the default image file.

  2. Click on the Home page again. The page file is still checked out (i.e., you can see the content management buttons and links). Click Edit Page to switch to edit mode.

  3. Click the Edit Picture control. This will open a new window where you configure what image to display and its settings (see Figure 9-4).

    image from book
    Figure 9-4

    1. Selected Image: (Mandatory) If you know the URL of to the image to be displayed, enter it in the field, or better yet click the Browse button to open the image libraries for the current site and for the site collection, and select the image to be displayed, then click OK.

    2. Alternate text: (Optional) This is text that will be displayed if you hover a mouse over the image.

    3. Hyperlink: (Optional) Use this field to add an URL link to the image; if a user clicks the image, this link will open. It could be used to open another site or a larger picture. Check Open Link In New Window to open the URL link in a separate window.

    4. Alignment: This setting is not used for images in this page content.

    5. Horizontal Spacing: Set the space in pixels before the image.

    6. Border thickness: Set the border thickness size in pixels; 0 is no border.

    7. Vertical Spacing: Set the space in pixels above the image.

    8. Use default image size: This will display the image in its true size. Note that large pictures may cause the page to look bad, so make sure that the size is okay before accepting this option. Below in the fields Width and Height, you can see the actual size in pixels for the image. A tip is to use image sizes less than 400 to make sure that the rest of this page is visible without the need to scroll the page horizontally.

    9. Specify Size: Use this to rescale the image. When this option is selected, you can enter any value in pixels for width and the height. Be careful about entering both these values manually, since it is very hard to keep the image's aspect ratio; instead, you should set either the width or height, then check Maintain aspect ratio to be sure that the picture looks good.

    10. Click OK to save and close this window.

  4. The new image is displayed on the content page. If this was all you wanted to do, then the next step is to publish it or submit it for approval, depending on the permission you have.

image from book

If you also want to modify the Page Content control, you can wait to publish the page. This Page Content control is a rich-text HTML editor with a lot of functionality to format the text, add tables and pictures, and more. Following is an example of how you can edit the content in the Page Content control add new HTML tables to structure the content, and add pictures and URL links to the Page Content control.

Try It Out Modify the Page Content Control

image from book
  1. If this page is not in edit mode yet, click Site Actions image from book Edit Page now.

  2. Click the link Edit Content in the Page Content control (or just click anywhere inside the Page Content control); a rich toolbar with a lot of buttons and menus will now be displayed (see Figure 9-5). Now you can start modifying this content. Below are some common examples:

    image from book
    Figure 9-5

  3. To modify the text, change its format and color:

    1. Place the cursor where you want to start, and type the new text, just as with any standard text editor. For example, change the headline from Welcome to Microsoft Office SharePoint Server 2007 to Welcome to MOSS 2007.

    2. Select the headline Welcome to MOSS 2007, then open the menu Styles and select ArticleTitle. This will format the selected text according to a style defined in a Cascading Style Sheet (CSS) file.

    3. Select any other text, for example the complete sentence beginning with "Get started with," and select the text color icon (an "A" with a color bar under), then select another color for this sentence and click OK.

  4. If you look closely at the content in this Page Content control, you can see that there are several tables, each with one or more columns and rows. This is a typical technique used when building HTML-formatted text on a web page to get control over where the content will be displayed. In each table cell you can add text, images, or any type of content supported by the control. For example, say that you want to add a second row to the top cell where the headline is. This is how you would do it:

    1. Place the cursor inside the top cell. A black arrow will be displayed in the top right of this cell. Click on it to open a menu, then select Insert Row Below.

    2. In the new cell, enter the text Microsoft Web Site, then mark the text and click the link icon on the toolbar (a globe with some links) to open a new dialog box. In the field Selected URL enter http://www.microsoft.com. Then check Open Link In New Window, and enter the tooltip This is Microsoft's Home Page. Then click OK to save and close this dialog box.

    3. Hover the mouse over the new text. Note that its tooltip says "This is Microsoft's Home Page" and that the text is underlined, indicating it is an URL link.

    Important 

    If you prefer to edit the HTML source directly, select the toolbar icon with a "<>" and a little pen.

  5. To add a picture to the text content, create an empty third row in the top table, just like you did in step 4 above:

    1. Place the cursor in the new cell.

    2. Click the image icon on the toolbar, (a mountain and a sun), and a new dialog box is displayed. Enter the URL to the picture, or click browse to open the image libraries discussed earlier when modifying the Image Page control, and select a picture - for example, the NewsArticleImage - and click OK.

    3. The same type of dialog window as shown in Figure 9-4 will now be displayed. This time, just change the size of the image so that it will not take too much space; select the option Specify Size, set Width to 150, and click OK.

  6. To publish all these modifications, click Publish in the content management toolbar. The new home page will look something like Figure 9-6 (depending on what images and modifications you have added).

image from book
Figure 9-6

image from book

This content page also contains a lot of Web Part zones, and some of them already contain one or more Web Parts. You manage them in the same way you manage Web Parts in any site; there is no specific functionality connected to these Web Parts being placed on a Publishing Page with content management features. Web Parts in general will be covered in Chapter 12, but since the Collaboration Portal site template contains some Web Parts by default, they will be discussed here also. Look at the top of the Home page. It lists three Web Parts, all stored in the Web Part zone named Right Zone:

  • q I need to: A Web Part that lists frequently used actions, such as creating news, creating a site, and opening a popular document library. By default this Web Part will only have one action listed: set up MySite.

  • q Employee Lookup: Enter an employee name, and SharePoint will search for this user.

  • q Top Site: This will list all web sites defined as a "Top Site." Typically, these are commonly used web sites.

So, how do you configure them? To start with, Employee Lookup does not need any configuration. It is just a link to the search site and its People search page. But you must configure the other two Web Parts. The content in these two Web Parts is populated by using the Sites web site. Follow these steps to add a new action to the "I need to" Web Part that will open the Image library and to make the IT web site a Top Site, as listed in this Web Part here.

Try It Out Modify the Intranet Portal's Web Parts

image from book
  1. Log on as a user with administrative permissions to the intranet site (for example, as the administrator).

  2. Open the Sites tab (which is a subsite to the Home site).

  3. Click Add Link to Site (in the upper-right corner of the page). This will open a web page where you normally add a link to a web site. This time, you will create a link to an action to be listed in the "I need to" Web Part. Enter the following values (see Figure 9-7).

    image from book
    Figure 9-7

    1. Title: Enter the text for the action you want listed in the "I need to" Web Part (for example, "Open the Image Library").

    2. Type the Web address: Enter the URL address (for example, http://srv1/PublishingImages). (Note that you do not need to add any description to this URL link; the title above will be enough.)

    3. Check the Top Tasks option.

    4. Click OK.

  4. Note that this link is not yet active, due to the fact that the list where these links are stored requires approval. The next step is therefore to approve the new link:

    1. On the Sites page, click View All Site Content.

    2. Under the section Lists, click Sites.

    3. Locate the new link Open the Image Library, and open its quick menu (click to the right of its name). Then select Approve/reject.

    4. Select the option Approve; type a comment if needed, and then click OK.

  5. The link is now active. Click Home to see if it works. Open the menu for the "I need to" Web Part, and select Open the Image Library, then click the green arrow to the right. The library will now be displayed; if not, you probably entered the wrong URL link.

image from book

The next example shows how to make a link to a web site named IT, which is listed as Top Site, and as result have it listed on the Top Site Web Part on the intranet Home page. This is also done using the Sites page.

Try It Out Define a Top Site

image from book
  1. Open the Sites page, then click View All Site Content.

  2. Click Sites in the Lists section. All existing site links are now listed.

  3. Locate the site IT. Open its quick menu, and select Edit Item.

  4. At the bottom of this web page, check Top Site and click OK.

  5. Again, this modification must be approved before everyone can see this top site. Use the quick menu again, and select Approve/reject, then select the option Approve and click OK.

  6. Test that it works: Click Home to open the intranet start page; verify that the link IT now is listed as a Top Site head. Click on IT and that site will open.

image from book

A tip is to be restrictive with the number of sites defined as Top Sites. One way to do this is to use permission settings for these links; if a user is not allowed to view (i.e., read) a link, then it will not show up as a Top Site.

News Editing

Let's look at another Publishing Page that may be even more frequently updated than the intranet home page. It is the News page, typically used by one or more content authors to add news items about their organization, partners, and customers. The News page is really a site, and you can either create it manually using the News site template or create it automatically when creating a site collection using the Collaboration Portal site template (in which case, the News site will be located directly under the intranet Home site). The content listed on this site is usually page files based on a specific layout file, suitable for news articles. The way you work with the news site and its news articles is almost identical to how you work with the Home page and its content; the main difference is the layout files used.

Adding News Articles

But there is one important difference: When updating the Home page on the intranet portal, you usually modify its actual page. But to add news you create one new page for each news item. It is really very simple; just click Site Actions image from book Create Page, enter a title and a name for the page file, then select any of the page layouts defined as Article Page. Enter the content for the news, according to the article layout you selected; for an example, see Figure 9-8, which shows the Article page with the body only.

image from book
Figure 9-8

As you probably recognize by now, this is a Publishing Page. It is based on the content management features that come with MOSS 2007. To enter the content, do exactly what you did for the intranet Home page described earlier: Click Edit Content and Edit Picture. Then click Publish or Submit for Approval, depending on the permission you have. When published, the news article is displayed in all its splendor. The title of the new page is also listed in the Quick Launch bar, under the News section, and if you hover the mouse over the News navigation tab at the top of the page, the title will be listed there, as well.

So adding news articles is not hard, but what if you want to change how they are presented on the News page? For example, look at the Figure 9-9; it shows three news articles, and two of them have a picture included in the article. The default layout for this News site page is to display the latest news with a picture, title, and description; under that is a list of the 15 of the latest news articles. Switch to edit mode for this News site page by clicking Site Actions image from book Edit Page, and you will see that the content on this page is split up into several Web Parts, in particular Recent News and News Roll Up, which both are based on the Content Query Web Part (see Figure 9-10).

image from book
Figure 9-9

image from book
Figure 9-10

The images in a news article are used in a special way. For example, the picture displayed on the Recent News Web Part in Figure 9-10 is the rollup image, defined on this news page. Now click the headline, or the picture, and the complete news article is displayed; the picture that is now displayed is the page image. In other words, the content added to a news article is used in the following way (note that some article layouts only use some of these content controls):

  • q Page Image: This picture will be displayed when the complete news article is opened.

  • q Image Caption: This text is only displayed together with the Page Image, that is, when the complete news article is opened.

  • q Article Date:This date is displayed at the top of the complete news article.

  • q Byline: This text is displayed at the top-right position of the complete news article.

  • q Page Content: This content (text, images, tables and links) is visible only when opening the complete news article.

  • q Rollup Image: This picture is visible only when the news item is presented in the Recent News Web Part.

All news articles are stored as page files in a document library named Pages; to display these page files you must open the News site, then click View All Site Content, and then click on Pages in the Document Libraries section. Just like the page files used for the intranet Home site, all these page files are by default under the control of the content management system in SharePoint 2007. You can check out, approve, undelete, view version history, and perform other actions on any of these news page files. To edit an existing news page, use either of these methods:

  • q Open the full news article, then click Site Actions Í Edit Page. The news article is automatically checked out, and you can start editing its content. When done, click Publish to make the new content publically available.

  • q Open the Page library, use the quick menu for the Publishing Page, then select Edit Properties (not Edit with SharePoint Designer, since that will allow you to edit the layout page instead of its content). When done editing, save the page file, then use the quick menu, and select Check-in, then use the quick menu again, and select Approve/reject this time.

Working with Images in MOSS

Do you start to see a pattern regarding how page files are used in MOSS? This is no coincidence, since all document library content is managed in the same way. This pattern is also valid for image libraries, except for the way that image libraries are populated. Since images are often used in news articles and on the Home page of the intranet, you should plan how to make these images available to the content authors. Since each tab on the intranet is a site (Home, News, Document Center, and so on), each of them may contain any number of image libraries. By default, MOSS will create these image libraries when you create a site collection using the Collaboration Portal site template. The purpose of these libraries is to store pictures to be used in Publishing Pages, such as news articles and files.

  • q Home: Contains two image libraries - Images, and Site Collection Images.

  • q News: Contains one image library - Images (it also contains another image library, for the general storage of pictures).

  • q Reports: Contains one image library - Images.

  • q Sites: Contains one image library - Images.

The exceptions are the Search and Document Center sites, and the reason is that they are not built upon the Publishing Page site template; in other words, they do not support the content management even though they are built by the MOSS site template. Look at the list above. Notice that each of these sites has one Images library that is supposed to store images to be used locally on that particular site. However, the Home page also contains a library named Site Collection Images. You can use that library to store pictures that you want to be available in any page supporting the content management system (for example, the exact list of sites above).

Although it is possible to add a picture to these image libraries just when you need them, it is much smarter to add all the images you will use before creating news articles and other page files. Just like the document libraries storing pages files, all image libraries are also configured to require checkin and approval before they are visible to everyone - even for pictures included in news articles. The working order for adding content to the intranet page is described in the Try It Out below.

Try It Out The Working Order for a Publishing Page's Content

image from book
  1. Locate all the images that the content authors will need when updating a Publishing Page, and news articles.

  2. If these images will only be used for news articles, add them to the Image library on the News site:

    1. Open the News page.

    2. Click View All Site Content.

    3. Click Images in the Document Libraries section.

    4. Click Upload. Either choose Browse and add a single image file or click Upload Multiple Files and add one or more files from any file folder (but only one folder at a time).

  3. If you instead want to use these images in more than one location, add them to the Site Collection Images library. This library is available on any Publishing Page:

    1. Open the Home page.

    2. Click View All Site Content.

    3. Click Site Collection Images in the Document Libraries section.

    4. Click Upload. Either choose Browse and add a single image file or click Upload Multiple Files and add one or more files from any file folder (but only one folder at a time).

  4. Notice that all uploaded images are listed as Draft in the Approval status column. If you look closely at the icon for these image files, you can see that each of them has a green arrow pointing down to the right. This is SharePoint's way of indicating that a file is checked out, that is, in draft mode. Now you must check in one each of these files, like this:

    1. Open the file's quick menu, and select Check-in, then select the option Major version (Publish). This will also list the new version number this file will get. You can add a comment here, if you wish. Click OK.

    2. The file is now waiting to be approved, that is, the column Approval Status now shows Pending. Next, open the file's quick menu again, and select Approve/reject. Then set the option Approved (if you do), and click OK. This image file is now ready to be used.

  5. Repeat steps 4a and 4b for each image file uploaded to publish all of them.

  6. Create or edit the page file that will include any of these image files, then use the Page Image or the Rollup Image control to select an image, or edit the Page Content control and use its Image button in the toolbar. All of these controls will allow the content author to select an image from these image libraries.

Important 

If you need to add a large number of image files, you can change the Check-out and Approval requirements for the Image library before uploading the files. When done, you should restore the default settings.

image from book

Creating News Layouts

The previous discussion has been all about predefined layout files for news articles. They are fine for many types of articles, but sometimes you need to create a new layout. This section tells you more about how to do that. The following table lists the news article layout files that come with MOSS 2007 by default.

Table 9.1: News Article Layout Files
Open table as spreadsheet

Filename

Page Layout

Description

PageFromDocLayout.aspx

"Article page with body only"

Contains only an Page Content control.

ArticleLeft.aspx

"Article page with image on left"

Contains one Page Image and one Image Caption control to the left, and a Page Content control to the right, plus an article date control, a byline control, and a Rollup Image control.

ArticleRight.aspx

"Article page with image on right"

Same controls as above, except that the Page Image and Image Caption controls are located on the right side of the page

ArticleLinks.aspx

"Article page with image on left"

Contains a Page Content control, and a Summary Links control, plus an article date control, a byline control, and a Rollup Image control

Remember that even page layout files without a Page Image control, such as the PageFromDocLayout.aspx, can contain any number of images, since they can be added inside the Page Content control (see Figure 9-11).

image from book
Figure 9-11

These files are stored in a special gallery for all types of layout files for this site collection, including news articles, intranet Publishing Pages, and Master Page files. To see these files, follow the steps in the next Try It Out.

Try It Out Display the Site Collections Layout Gallery

image from book
  1. Make sure to log on as an administrator for this site collection.

  2. Open the top site for the site collection, for example, http://srv1.

  3. Click Site Actions image from book Site Settings image from book Modify All Site Settings.

  4. In the section Galleries, click Master pages and page layouts. Now all files in this Master Page Gallery are displayed; see Figure 9-12, where three of the four Publishing Pages described in the table above are listed (the fourth is further down on this list). Note that you can see if the files are published or in draft status, and who has done the last update of the file and when.

image from book

image from book
Figure 9-12

Creating a Page Layout File

You can either edit one of these four default page layout files, and save it under a new name, or you can create a new file from scratch. If you edit one of the existing files, you will automatically get the right type of file, but if you create one from scratch, you must understand how to define it properly so that it will show up as a Publishing Page layout when creating a News page. By default, there are three types of page layout files to choose from when creating a News page:

  • q Article Page: This is the page layout that most news articles are built on. The layout files described in the previous table are Article Pages.

  • q Redirect Page: This is a special page layout that is used to create Redirect Pages. A user opening this page will automatically be redirected to the URL specified on this page within five seconds.

  • q Welcome Page: There are a number of Welcome Pages, and they are most often used to add extra pages to the intranet site, not for news articles, but they can be used for news articles as well.

In other words, when creating a new page layout file for news articles, you will most often create an Article Page. Let's use an example again. Say you need a page layout that allows you to add one page image, page content, one article date control, and one summary link control field. Since there is no such page layout, you must create it. The steps in the Try It Out below tell you how to do this.

Try It Out Create a Page Layout File for News Articles

image from book
  1. Make sure to log on as an administrator for this site collection; open its top site. (You can also do this from most other web sites based on MOSS templates.)

  2. Open the Page Gallery. Click Site Actions image from book Site Settings image from book Modify All Site Settings.

  3. Click Master pages and page layouts. All layout files in the Master Page Gallery are now listed.

  4. Click New at the top of the list to create the new page layout file.

  5. Make sure the Content Type Group is Page Layout Content Type, and set Content Type Name to Article Page.

  6. Enter the URL Name is the name for this Page Layout file; for example, MyFirstLayout. Note that the file will automatically get the .aspx file extension.

  7. Enter the Title and the Description; these will be displayed later in the page layout list.

  8. There is a section for adding Variation Labels. These are used when creating a page layout in more than one language (for example, Danish and Russian). To do that, you need to add these variation labels before creating the layout file. So, this time just click OK.

  9. The result is now a new page layout file, stored in the Master pages and page layouts gallery. But the file is empty at the moment. The next step is to add the layout controls to it. Locate the new file (for example, MyFirstLayout.aspx file); open its quick menu (click to the right of the page name), and select Edit in Microsoft Office SharePoint Designer.

  10. You will now see both the new and empty page layout file, plus its Master Page, showing all the menus, buttons, and Quick Launch items. In the content part of the page, that is, the center of the page, you will see a row named PlaceHolderMain; it is this part you want to configure.

  11. Mark the PlaceHolderMain in the content part; all your control fields must be stored within this PlaceHolderMain control. The problem is that it is hard to add a control field and make it stick to a specific place. This is easily solved by creating a table inside PlaceHolderMain, then add the control fields to each cell in the table: Click the Table menu and then Insert Table, next set the number of rows = 2 and columns = 2, and then click OK. Note that a consumer of this web page will never see the actual table; it is only used by the designer to add the controls in a specific position. See Figure 9-13.

    image from book
    Figure 9-13

  12. In the toolbox at the right of the SharePoint designer, you will see a number of control fields that you can use in this news page layout. The most commonly used are these grouped by the Content Field. Locate the Article Date and drag it to the top left cell in the PlaceHolderMain area. Then drag the Page Image to the second column on the first row. Now drag the Summary Links to the second row, first column, then drag the Page Content control to the second cell in the second row. The layout is now ready (see Figure 9-13).

  13. The next step is to save it. In the SharePoint Designer, click File image from book Save (or press Control+S on the keyboard).

  14. The next step is to check in, and then approve the file, to make it publically available:

    1. Close the SharePoint Designer.

    2. Open the Master Page Gallery if it is not yet displayed; locate the newly created layout file (MyFirstLayout.aspx), then open its quick menu: select Check In.

    3. Select the option Major Version. If this is the first time you edited this file, the major version will be 1.0.

    4. Locate the MyFirstLayout.aspx file again, then open its quick menu, and select Approve/reject, then click OK. This page layout file is now ready to be used.

  15. Let's test the new layout: Open the News page, then click Site Actions image from book Edit Page. Enter a page title, and a description, then select the new layout file: (Article Page) My First Layout File and click Create. The result will look like Figure 9-14.

    image from book
    Figure 9-14

  16. Enter some content into each of these seven page controls. The news article must now be checked in, then approved, just like any page file. If you have the permission, click Publish now; if not, click Submit for Approval, and ask the user with Approve permission to approve the page. The new article is now listed on the News page.

image from book

More about Page Layouts

The editing functionality in SharePoint Designer is very rich, and it will take some time before you master it. Chapter 13 will cover more details about working with SharePoint Designer, but below are some tips that will help you get started with the page layouts for news articles. To start with you can change an existing page layout file, and this will affect both existing news articles and those created from this moment on. For example, say that you need to add Web Part zones to the layout file, thus allowing the content author to add Web Parts later on. None of the default article layouts has this functionality, but it could be very interesting in some cases. For example, say that you once in a while want to create a news article that also contains a list of the latest customers, stored in a Customer list in the News site. In the Try It Out below you will change the page layout of the MyFirstLayout.aspx file.

Try It Out Edit an Existing Page Layout File

image from book
  1. Make sure to log on as an administrator for this site collection, and open its top site. (You can also do this from most other web sites based on MOSS templates.)

  2. Open the Page Gallery. Click Site Actions image from book Site Settings image from book Modify All Site Settings.

  3. Click Master pages and page layouts. All layout files in the Master Page Gallery are now listed.

  4. Locate the MyFirstLayout.aspx file. Open its quick menu, and select Edit in Microsoft Office SharePoint Designer. A dialog box informs you that this requires the file to be checked out; click OK.

  5. SharePoint Designer starts and displays the page layout file. Locate the PlaceHolderMain part in the middle of the page. Previously you created a table with two rows and two columns. It is best to create a new row where the new Web Part zone will be stored:

    1. Place the cursor at the beginning of the second row, and you will see a small arrow pointing to the right. Click the left mouse button to select the complete row, then rightclick and select Insert image from book Row Below. Now you have three rows.

    2. Set the cursor in the second column of the third row (because it is widest), then click on the Insert menu on the SharePoint Designer toolbar, and select SharePoint Controls image from book Web Part Zones. The new zone is created in the table.

  6. Save the modified page layout: Click File image from book Save, then:

    1. Close the SharePoint Designer.

    2. Open the Master Page Gallery, locate the newly modified layout file (MyFirstLayout.aspx), then open its quick menu, and select Check In.

    3. Select the option Major Version. The major version will be 2.0, since you have edited this file.

    4. Open the quick menu for MyFirstLayout.aspx again, and select Approve/reject, then click OK. This page layout file is now ready to be used.

  7. Let's test the new layout: Open the News page and create a new Page file based on the MyFirstLayout.aspx, as previously described. Note that it now allows the content author to add any number of Web Parts into the new Web Part zone. Figure 9-15 shows what this looks like when you're editing the page, and Figure 9-16 shows an example where a Web Part displaying a Contact list named Customers has been added. (You will need to create this contact list before you can add it as a Web Part to this page.)

image from book
Figure 9-15

image from book
Figure 9-16

image from book

If you now edit one of the existing news articles that was built on this page layout file, you will see that the new Web Part zone is displayed. In other words, changing the page layout file will also affect existing news articles. The reason is that when this news article is displayed, SharePoint will open the layout file and fill in the content in its control fields and Web Parts. This also explains why you cannot remove a page layout file as long as there is at least one news article still using it. If you try this, SharePoint will display this error: "This item cannot be deleted because it is still referenced by other pages." If you want to see which news articles use this page layout, follow the steps in the Try It Out below.

Try It Out Display the Page Layout Used by News Articles

image from book
  1. Open the News site.

  2. Click View All Site Content, then click Pages.

  3. Look at the column Page Layout (by default at the far right). This is the page layout file that is used by this news article. You can click OK on the column header Page Layout to sort it, to make it easier to see all news articles used by a specific page layout file.

image from book

The content management features in MOSS are very powerful but still easy to use. However, to make the most of web content management, the content authors must take some time to learn how it works. The good news is that it is a lot of fun!



Beginning SharePoint 2007 Administration. Windows SharePoint Services 3 and Microsoft Office SharePoint Server 2007
Software Testing Fundamentals: Methods and Metrics
ISBN: 047143020X
EAN: 2147483647
Year: 2004
Pages: 119

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net