Making PublishingWebControls Disappear in MOSS

Home » SharePoint Development » Making PublishingWebControls Disappear in MOSS

Making PublishingWebControls Disappear in MOSS

Posted on

PublishingWebControls in MOSS are a great feature, allowing editors to add all kinds of formatted content to publishing pages based on site definition content types.  Unlike web part zones in WSS, however, these controls don’t completely disappear from the page when no content has been added to them.  What gives with all that ugly white space? 
By default, the MOSS styles set a minimum height of 50px for the areas which contain the publishing controls – splashLinkArea and splashLinkFrame.  Even though you may never reference these styles explicitly in your custom layout page, the markup is created dynamically when a <PublishingWebContros:[FieldType] … /> control is inserted on a page.  Just to be difficult, it also adds a fixed height of 100px  to the splashLinkFrame style.   Well, here’s a simple CSS trick to make them play nice with your design and go into hiding when they’re not doing something important.  Add the following to the end of your custom CSS file:
 
.splashLinkArea
{
min-height: 0px;
}
.splashLinkFrame
{
min-height: 0px;
height:0px;
}
 
Problem solved.  If you’re using a custom layout page or site definition and not setting custom styles explicitly in MOSS for each site collection, you should also add a reference to your custom stylesheet to your master page to insure the override styles are called last.