Custom Search Control Not Being Displayed in Meeting Workspace
Objective:
Include an additional search control adjacent to the standard search box on a Meeting Workspace site, but not show any search controls on system pages (as is the default).
Problem:
The Meeting Workspace masterpage MWSDefaultv4.master includes the ContentPlaceHolder with id="PlaceHolderSearchArea" to display the standard search box.
You might expect that if you modify the masterpage to include another control that it would display, however, the default.aspx page in the Meeting Workspace site includes this ContentPlaceHolder and it includes the standard search box. This means that it will replace the contents of the placeholder from the masterpage.
Resolution:
There are a couple of options to resolve this, depending on your requirements.
Option 1:
This solution, as a workaround, only requires an update to the MWSDefaultv4.master (or alternatively creating a new masterpage based on this one), and no change to any other files. The side effect though is the search box will now appear on the system pages (like Site Settings).
1. Copy the asp:ContentPlaceHolder with id=PlaceHolderSearchArea
2. Set Visible=False on the original (a common technique to make sure you don't break things that have a dependency on the existence of particular placeholders)
3. Change the id on the copy to something else
4. Put the custom control after the delegate
The end result should be something like this:
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server" Visible="false">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" Version="4"/>
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder id="PlaceHolderSearchAreaCustom" runat="server">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" Version="4"/>
<span> Or </span><div>MY CONTROL HERE</div>
</asp:ContentPlaceHolder>
Option 2:
This option fixes the root cause by removing the content placeholder that is preventing the masterpage customisation from displaying correctly.
- Change the Master page to include the custom control in the ContentPlaceHolder with id="PlaceHolderSearchArea"
- Remove the ContentPlaceHolder with id="PlaceHolderSearchArea" from default.aspx
Enjoy!
This post was co-authored by:
Christopher Walker
SharePoint Consultant
Christopher.Walker@microsoft.com
LinkedIn
James Kemp
SharePoint Architecture Consultant
James.Kemp@Microsoft.com
LinkedIn
Bio