FAO VinceB1 - SharePoint Masterpages

Soldato
Joined
1 Feb 2006
Posts
8,188
If anyone else can help that would be great but I think VinceB1 is the man here for SharePoint development.

I'm looking to make a small change to the default.master file in order to hide the search bar on SP pages.

Now I could just take a copy of the original on each Web Front End and edit the file but I'd prefer to use a feature to control this so that changes to one WFE are replicated on the others. Is this do-able?

If so where do I put my new masterpage file? I would expect to have to create a feature.xml inside a new folder in the features directory. After this I haven't a clue.

Any help would be greatly appreciated.
 
Here is an update of what I have so far - it doesn't work by the way!

Feature.xml
Code:
<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="9014276c-3512-4318-9992-23326ed00540" 
         Title="No Search Master Page"
         Scope="Site"
         Version="1.0.0.0"
         Hidden="FALSE" 
         DefaultResourceFile="core"
         xmlns="http://schemas.microsoft.com/sharepoint/" 
         Description="This Feature contains a custom master page which hides the search boxes">
<ElementManifests>
  <ElementManifest Location="Elements.xml" />
  <ElementFile Location="MasterPages\NoSearchMasterPage.master" />
</ElementManifests>
</Feature>

Elements.xml
Code:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="CustomMasterPage" 
          Url="_catalogs/masterpage" 
          Path="MasterPages" 
          RootWebOnly="FALSE">
    <File Url="NoSearchMasterPage.master" Type="GhostableInLibrary" />
  </Module>
</Elements>

Here is the layout of my Visual Studio with WSP Builder
SPFeatures.jpg
 
Got it sorted - had to scope it at web rather than site. Added some event receivers and now it is doing what it's meant to do.

Next step is to build a theme into a feature.
 
Back
Top Bottom