14.3. Edit Model Panel

At some point in a Publishing site project, business requirements will dictate that the author's editing experience should be different from that of the display experience. For example, what if some fields on a page need to be edited by the content authors but not shown to people browsing the site? This technique comes in handy when a page needs to have some metadata associated with it at the same time that it would be used in classifying or grouping pages in a Content Query Web Part or for more advanced searching techniques.

The way to provide different editing and display experiences in MOSS 2007 Publishing sites is through the EditModePanel. The EditModePanel, used in page layouts, is an ASP.NET 2.0 composite control in that it can contain child controls. By default, it only renders the controls within the panel when the page is in Edit mode, but this is configurable using the PageDisplayMode property. When the PageDisplayMode property is set to Display, it displays the controls when the page is in Display mode. When the PageDisplayMode property is set to Edit (which it is by default), it displays the controls when the page is in Edit mode.

The EditModePanel is demonstrated in the page layouts included in the Publishing Portal site template — specifically, those associated with the Article Page content type (see Figure 14-3). A gray box is rendered at the bottom of a page containing a field control for a thumbnail image. The intention is to not use this ...

Get Professional SharePoint® 2007 Web Content Management Development: Building Publishing Sites with Office SharePoint Server 2007 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.