0 people following this project (follow)

Project Description
One of the limitations of SharePoint is the inability to recognize empty field controls or web part zones and to reconfigure the layout. This of course presents problems for SharePoint sites where content is varied and/or constantly updated.

SharePoint page layouts entities such as fields or web part zones are monitored by the DisplayObserver. The DisplayObserver recognizes empty controls on a page and takes actions defined by the designer which rebalance the web page content with layout. For example, controls can be hidden or their CssClass can be changed.

An Example:


A page with Content: a page image with subtitle, two link summaries and a lower web part zone with one web part.


The same page with less content.
  1. The page image is missing but its subtitle is still shown.
  2. The left link summary field has no links and so produces white space.
  3. The lower web part zone is empty but the table row still has its style information to consume 100px min-width.


The same page with less content and the DisplayObserver.
  1. The image subtitle is hidden because of the empty page image.
  2. The container of left link summary is hidden because the empty link summary field.
  3. The lower empty web part zone which is hidden.

The HTML Code for this example

<!-- Hide the control 'imageSplash' when 'ImageField; is empty -->
<itacs:DisplayObserver runat="server">
  <Triggers>
    <itacs:DisplayTrigger TriggerID="ImageField"/>
  </Triggers>
  <Actors>
    <itacs:DisplayActor ActorID="imageSplash" Visible="false" />
  </Actors>
</itacs:DisplayObserver>
<div class="imageSplash" runat="server" id="imageSplash">
  <PublishingWebControls:RichImageField id="ImageField" FieldName="PublishingPageImage" runat="server"/>
  <div style="font-size:12px;">
    <SharePointWebControls:NoteField FieldName="Comments" runat="server"></SharePointWebControls:NoteField>
  </div>
</div>
<!-- Hide the control 'splashLinkArea1' when 'SummaryLink1; is empty -->
<itacs:DisplayObserver runat="server">
  <Triggers>
    <itacs:DisplayTrigger TriggerID="SummaryLink1"/>
  </Triggers>
  <Actors>
    <itacs:DisplayActor ActorID="splashLinkArea1" Visible="false" />
  </Actors>
</itacs:DisplayObserver>
<!-- Hide the control 'splashLinkArea2' when 'SummaryLink2; is empty -->
<itacs:DisplayObserver runat="server">
  <Triggers>
    <itacs:DisplayTrigger TriggerID="SummaryLink2"/>
  </Triggers>
  <Actors>
    <itacs:DisplayActor ActorID="splashLinkArea2" Visible="false" />
  </Actors>
</itacs:DisplayObserver>
<!-- Hide the control 'TopZoneRow' when 'TopZone; is empty -->
<itacs:DisplayObserver runat="server">
  <Triggers>
    <itacs:DisplayTrigger TriggerID="TopZone"/>
  </Triggers>
  <Actors>
    <itacs:DisplayActor ActorID="TopZoneRow" Visible="false" />
  </Actors>
</itacs:DisplayObserver>
<table cellpadding="0" cellspacing="0" class="splashLinkFrame">
  <tr>
    <td>
      <table cellpadding="0" cellspacing="6" width="100%" class="splashLinkFrame">
        <tr>
          <td width="50%" valign="top" class="splashLinkArea" runat="server" id="splashLinkArea1">
            <PublishingWebControls:SummaryLinkFieldControl id="SummaryLink1" FieldName="SummaryLinks" runat="server"/>
          </td>
          <td width="50%" valign="top" class="splashLinkArea" runat="server" id="splashLinkArea2">
            <PublishingWebControls:SummaryLinkFieldControl id="SummaryLink2" FieldName="SummaryLinks2" runat="server"/>
          </td>
        </tr>
        <tr runat="server" id="TopZoneRow">
          <td colspan="2" width="100%" valign="top" class="splashLinkArea">
            <WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="TopZone" FrameType="TitleBarOnly"
              Title="<%$Resources:cms,WebPartZoneTitle_Top%>" Orientation="Vertical"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<a href="/">Contact Us</a>

Installation

  • extract the ZIP
  • change the TARGET_SITECOLLECTION path in the install.cmd to your designated SharePoint SiteCollection
    • The feature automatically registers the itacs prefix for the ASP.Net page.

Check out our other solutions like the SharePoint Post Installation Tool (PIT) and the Change Password Webpart.

Last edited May 15 2009 at 12:46 PM by smw, version 4