Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Same as for a custom v4.master, I want to create a custom minimal.master. The common advice: make a copy of minimal.master and then modify it. But how can I reference to the custom minimal.master? ( Such as for the v4.master, this can be changed by the Site Settings. )

share|improve this question

3 Answers 3

up vote 1 down vote accepted

Depending on how much you need to customize minimal.master you have two options:

  1. If it's enough to be able to insert special css/javascript, then you can use a Control element to replace the DelegateControl with id "MinimalMasterSiteLogo"
  2. If you need completely new html, then you have to overwrite minimal.master in the LAYOUTS folder as the pages using minimal.master refer to it directly.
    1. Remember that this will affect all sites!!!!
    2. Remember to keep a copy of both the original and the custom one, the first to use if there is any problems, the second to when a patch/SP overwrites your custom one.

BUT if you're developing for Office365 or another environment where you can only deploy sandboxed solutions then neither of the above will work. Then you have to resort to the following hack:

  1. Create a sandboxed solution (or extend an existing one)
  2. Add a new item of type Module (I call mine ChangeMiniMaster)
  3. Change sample.txt to a javascript file (I call mine ChangeMiniMaster.js)
  4. Add a CustomAction element to the Elements.xml like this:

    <CustomAction  
      ScriptSrc="~SiteCollection/ChangeMiniMaster/ChangeMiniMaster.js"  
      Location="ScriptLink"  
      Sequence="1000">  
    </CustomAction>
    

The javascript file will be loaded on every page so you have to make some check to see if you're on a page using minimal.master (I check for an element with the id 's4-mini-testarea') and then you have to make all your changes using javascript.
Here is a small example:

function changeMiniMasterInit() {
    var miniTitleArea = $get('s4-mini-titlearea');
    if (miniTitleArea) {
        miniTitleArea.innerHTML = "This is my special title area";
    }
}
_spBodyOnLoadFunctionNames.push('changeMiniMasterInit')
share|improve this answer
    
Unfortunately I have to go for option 2. To bad this can't be setup as like the "normal" master-page. –  Farrell Mar 22 '12 at 8:28
    
The reason MS has given is that the pages using this masterpage should always work, so they don't want the risk involved when users can change the masterpage. So when you change it be very careful –  Per Jakobsen Mar 22 '12 at 8:47
    
Unfortunately when I modify the minimal.master, nothing changes. So maybe anothter question is, which master-page is used by _layouts/WordViewer.aspx? –  Farrell Mar 22 '12 at 13:41
    
It is using minimal.master to verify take the original minimal.master and insert some text as the first line inside the body tag. But the question of how to make it look nice is then something completely different, because WordViewer.aspx takes over a great part of the browser window –  Per Jakobsen Mar 22 '12 at 14:16
    
That's exactly what I did. I also checked the minimal.master in as a major version and approved it. But nothing extra shows up in the rendered page. Therefor I was assuming that minimal.master isn't referenced inside the WordViewer.aspx –  Farrell Mar 22 '12 at 14:56

Are you asking how to load the custom master page? It should be referenced just like a custom v4.master. All you need to do is upload and publish the custom.master file and then it should be in the dropdown.

share|improve this answer
    
Nope, I was asking how to setup/load/reference a minimal.master. This is a different master-page, which is used for example by opening a Word document inside the SharePoint site. –  Farrell Mar 22 '12 at 8:26

SharePoint Designer could be used as well.. just right-click and activate as custom master or default master..

share|improve this answer
    
This approach doesn't work for the minimal.master. If you do that with the minimal.master then the site will crash. –  Farrell Mar 22 '12 at 8:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.