Subscribe to News feed

Add real-time filtering to all lists and libraries in a SharePoint Site Collection

Posted at: 9:13 AM on 24 September 2009 by Muhimbi

InfuserBoxWe love it when third parties start writing code and examples for our products, it makes writing new blog entries very simple and quick. Today we got another cool Infuser script from Jaap Vossers who previously brought us the script that allows Site Settings to be opened using a keyboard shortcut.

Today’s script is a JavaScript based solution that adds filter-as-you-type textboxes to every column of a SharePoint list or document library. It uses jQuery to add the textboxes and perform the filtering.

As an added bonus it adds filtering to field types that normally aren’t filterable, like calculated and note columns.

 InlineListFilter


Jaap has made the code available on CodePlex, but it is probably easier to just paste the code listed below directly into Infuser.

Follow the steps outlined below to add this cool script to your site collection:

  1. Download and install Muhimbi’s free SharePoint Infuser on one of your Web Front End Servers.
     
  2. Ensure you have Designer privileges, more specifically the Add and Customize Pages right.
       
  3. In your SharePoint Site collection, on the Site Actions / Site Settings screen, select Infuse custom content from the Look and Feel column.
     
  4. Paste the code displayed below into Infuser’s code window. If you are using IE then you may want to paste it in WordPad first , otherwise all line breaks are stripped out.
     
  5. Click the Save button, navigate to any list and start filtering.
     
<script src="/_layouts/Muhimbi.Infuser/JQuery/jquery-1.3.2.min.js"></script>
<script>
// SharePoint InstantListFilter - developed by Jaap Vossers
$(document).ready(function()
    jQuery.extend(jQuery.expr[':'], {
       containsIgnoreCase: function(a,i,m) {return (a.textContent||a.innerText||
                     jQuery(a).text()||'').toLowerCase().indexOf((m[3]||'').toLowerCase())>=0}
     });
 
  $("table.ms-listviewtable tr.ms-viewheadertr").each(function()
  {
    if($("td.ms-vh-group", this).size() > 0)
    {
      return
    }
 
    var tdset = "";
 
    var colIndex = 0;
 
    $(this).children("th,td").each(function()
    {
      if($(this).hasClass("ms-vh-icon"))
      {
        // attachment
        tdset += "<td></td>";
      }
      else
      {
        // filterable
        tdset += "<td><input type='text' class='vossers-filterfield' filtercolindex='" + 
                 colIndex + "' /></td>";        
      }
 
      colIndex++;
    });
 
    var tr = "<tr class='vossers-filterrow'>" + tdset + "</tr>";
 
    $(tr).insertAfter(this);
  });  
 
 
  $("input.vossers-filterfield")
    .css("border", "1px solid #7f9db9")
    .css("width", "100%")
    .css("margin", "2px")
    .css("padding", "2px")
    .keyup(function()
    {      
      var inputClosure = this;
 
      if(window.VossersFilterTimeoutHandle)
      {
        clearTimeout(window.VossersFilterTimeoutHandle);
      }
 
      window.VossersFilterTimeoutHandle = setTimeout(function()
      {
        var filterValues = new Array();
 
        $("input.vossers-filterfield", $(inputClosure).parents("tr:first")).each(function()
        {        
          if($(this).val() != "")        
          {
            filterValues[$(this).attr("filtercolindex")] = $(this).val();
          }
        });    
 
 
        $(inputClosure).parents("tr.vossers-filterrow").nextAll("tr").each(function()
        {
          var mismatch = false;
 
          $(this).children("td").each(function(colIndex)
          {
            if(mismatch) return;
 
            if(filterValues[colIndex])
            {
              var val = filterValues[colIndex];
 
              // replace double quote character with 2 instances of itself
              val = val.replace(/"/g, String.fromCharCode(34) + String.fromCharCode(34));              
 
              if($(this).is(":not(:containsIgnoreCase('" + val + "'))"))
              {
                mismatch = true;
              }            
            }
          });
 
          if(mismatch)
          {
            $(this).hide();
          }
          else
          {
            $(this).show();
          }    
        });        
 
      }, 250);
    });
});  
</script>

Labels: , ,

Opening the SharePoint Site Settings screen instantly using a keyboard shortcut

Posted at: 9:18 AM on 21 September 2009 by Muhimbi

InfuserBox As we are active SharePoint developers, hey it is all we do, we need access to the Site Settings screen on a regular basis. As 'real developers’ we prefer keyboard shortcuts as, quite frankly, picking up the mouse, navigating to the Site Actions menu and then clicking Site Settings is just waaaay too time consuming.

A couple of months ago we came around a cool tool from Jaap Vossers, which installs a web control on your SharePoint server to automatically hook up the ctrl-s key to the Settings screen. As we don’t like to install any new software on our servers we challenged Jaap to rewrite it in such a way that it would work with our free SharePoint Infuser tool, which has the ability to automatically inject any script or HTML in all pages on a site collection without causing any nasty side effects such as ghosting etc.

 InlineSettings

 
It took Jaap a cool hour to change things around, make it look all pretty, and release it as a CodePlex project. It works fantastically and it is now enabled by default on all site collections on our development servers.

Follow the steps outlined below to add this great trick to your site collection:

  1. Download and install Muhimbi’s SharePoint Infuser on one of your Web Front End Servers.
     
  2. Ensure you have Designer privileges, more specifically the Add and Customize Pages right.
       
  3. In your SharePoint Site collection, on the Site Actions / Site Settings screen, select Infuse custom content from the Look and Feel column.
     
  4. Paste the code displayed below into Infuser’s code window. If you are using IE then you may want to paste it in WordPad first , otherwise all line breaks are stripped out.
     
  5. Click the Save button, navigate to any page in the site collection and press ctrl-s.
     
<link rel="stylesheet" type="text/css"
      href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/cupertino/jquery-ui.css"/>
 
<script src="/_layouts/Muhimbi.Infuser/JQuery/jquery-1.3.2.min.js"></script>
<script src="http://js-hotkeys.googlecode.com/files/jquery.hotkeys-0.7.8-packed.js"></script>
<script src="http://jqueryui.com/latest/ui/ui.core.js"></script>
<script src="http://jqueryui.com/latest/ui/ui.dialog.js"></script>
 
<script type="text/javascript">
function ToggleInlineSiteSettings()
{ 
  var dlg = $("#InlineSiteSettingsWrapper");
 
  if(dlg.dialog("isOpen"))
  {
      $("#InlineSiteSettingsWrapper").dialog('close');  
  }
  else
  {
      $("#InlineSiteSettingsWrapper").dialog('open');      
  }
 
  return false;
}
 
$(document).ready(function()
{ 
  var hasPermissions = $("[id$='_MenuItem_Settings']").size() > 0;
 
  if(hasPermissions)
  {  
      $(document).bind("keydown", "Ctrl+s", ToggleInlineSiteSettings);
 
      var siteSettingsUrl = L_Menu_BaseUrl + "/_layouts/settings.aspx";
 
      $("<div id='InlineSiteSettingsWrapper'></div>")
        .css("background-color", "white")
        .load(siteSettingsUrl + " #ctl00_PlaceHolderMain_SettingLinks")
        .dialog({ width: "90%", modal: true, autoOpen: false});
    }
});
</script>

Labels: , ,

How to Float the SharePoint Quick Launch menu with the location of the scroll bar

Posted at: 6:54 PM on 04 August 2009 by Muhimbi

Another day and another cool example of how the SharePoint user interface can be modified using our free SharePoint Infuser. Today we are using some JavaScript magic to make this carpet … errrr … menu float in the same position while scrolling through a page.

To ensure this new functionality is added to every page in the Site Collection we use Infuser rather than the Content Editor Web Part. The JavaScript code is relatively simple, all it does is hook the scroll event, check if the menu is about to scroll off-screen and then re adjust the ‘top’ of the menu with the position of the scroll bar. Some additional code inserts a place holder element in the space that used to be occupied by the menu to ensure the width of this area doesn’t collapse.

There are more elegant ways to achieve floating effects, but the advantage of this code is that it works in IE6,7,8, FireFox, and Google Chrome. (It really works brilliantly in Chrome, as smooth as it gets)
 

FloatingMenu Notice how the Quick Launch menu scrolls with the content


Follow the steps outlined below to implement the changes on your site collection:

  1. Download and install Muhimbi’s SharePoint Infuser on one of your Web Front End Servers.
     
  2. Ensure you have Designer privileges, more specifically the Add and Customize Pages right.
     
  3. From the Site Actions / Site Settings screen, select Infuse custom content in the Look and Feel column.
     
  4. Copy the script at the end of this posting and paste it into Infuser’s code window. If you are using IE then you may want to paste it in WordPad first , otherwise all line breaks are stripped out.
     
  5. Click the Save button and navigate to any page that is long enough to have a scroll bar and scroll the window down.
     
<!-- Load the JQuery Libraries that ship with Infuser -->
<script type="text/javascript" src="/_layouts/Muhimbi.Infuser/JQuery/jquery-1.3.2.min.js"></script>
 
<script type="text/javascript">
    /**********************************************************************
      Floating SharePoint Menu, compatible with IE6,7,8 Chrome, Firefox
      Created by www.muhimbi.com, This sample code is provided on an “as is”
      basis and without warranty of any kind.
    ***********************************************************************/
 
    var scrollMenuElement = null;
    var menuElementTop = 0;
    var menuElementWidth = 0;
 
    function scrollMenu()
    {
        // ** Initialise during the first scroll event
        if(scrollMenuElement == null)
        {
            // ** Get the container that holds the navigation menu(s)
            scrollMenuElement = $("#LeftNavigationAreaCell > table");
            menuElementTop = scrollMenuElement.position().top;           
 
            // ** Request and explicitly specify width for Firefox & Chrome
            menuElementWidth = scrollMenuElement.width();
            scrollMenuElement.css("width", menuElementWidth);
 
            // ** put content in the same size of the menu to prevent collapse
            scrollMenuElement.before("<div style='width:" + menuElementWidth + "px'></div>");
 
            // ** Switch to absolute positioning to allow floating         
            scrollMenuElement.css("position", "absolute");
        }
 
        var scrollTop = $(document).scrollTop();
        // ** Has the element scrolled out of the window?
        if(scrollTop > menuElementTop)
        {
            scrollMenuElement.css("top", scrollTop +"px");
        }
        else
        {
            // ** Sometimes we scroll in large chunks so make sure it lines up
            scrollMenuElement.css("top", menuElementTop +"px");
        }
    }
 
    jQuery.event.add(window, "scroll", scrollMenu);
</script>
 

.

Labels: , ,

Fixing SharePoint’s Wiki by adding a home button and repairing the breadcrumb

Posted at: 11:41 AM on by Muhimbi

loopback It has been less than a week since we released our free SharePoint Infuser and we are already at our third blog posting.

Today we are fixing something that has been bothering us for a long time, which is the lack of proper navigation in the SharePoint Wiki, particularly the lack of a ‘home’ button and the fact that the Breadcrumb navigates to allitems.aspx. Grrrrrr.

So, in order to fix this we use SharePoint Infuser to insert the appropriate JavaScript into every Wiki Page in one go. Similar workarounds have been available for a while, but they need to be applied to each wiki page separately, which isn’t a scalable solution.

We are using Chris Chapman’s article on how to add buttons to the Wiki Toolbar as a starting point, we then add some JQuery magic to locate the appropriate breadcrumb link and set its URL to the wiki home page in a way that works across different languages as this page is not always called ‘home.aspx’.

 WikiHome


Follow the steps outlined below to implement the changes on your Wiki:

  1. Download and install Muhimbi’s SharePoint Infuser on one of your Web Front End Servers.
     
  2. Ensure you have Designer privileges, more specifically the Add and Customize Pages right.
     
  3. From the Site Actions / Site Settings screen, select Infuse custom content in the Look and Feel column.
     
  4. Copy the script at the end of this posting and paste it into Infuser’s code window. If you are using IE then you may want to paste it in WordPad first , otherwise all line breaks are stripped out.
     
  5. Click the Save button and navigate to any Wiki page.
     

Note that the script below works without modification on a ‘Wiki Page Library’. In order to make it work on a ‘Wiki Site’ change the ‘wikiHome’ variable to ‘../’ or whatever the equivalent of ‘home.aspx’ is in your language.

<!-- Load the JQuery Libraries that ship with Infuser -->
<script type="text/javascript" src="/_layouts/Muhimbi.Infuser/JQuery/jquery-1.3.2.min.js"></script>
 
<script type="text/javascript">
    function addWikiHomeButton()
    {
        // ** Are we on a wiki page?
        if($("table.ms-wikitoolbar").length > 0)
        {
            // Wiki home page that works across multiple languages
            var wikiHome = ".";
 
            // Fix the breadcrumb title
            $("span[id$=PlaceHolderTitleBreadcrumb_ContentMap] a:last").attr("href", wikiHome);
 
            // make copies of the layout cells for the wiki toolbar
            var $tdSeparator = $("table.ms-wikitoolbar tbody tr td.ms-separator:first").clone();
            var $tdToolbar = $("table.ms-wikitoolbar tbody tr td.ms-toolbar:first").clone();
            var $tdLastCell = $("table.ms-wikitoolbar tbody tr td.ms-toolbar[width]:last").clone();
            var $parent = $("table.ms-wikitoolbar tbody tr td.ms-toolbar[width]:last").parent();
 
            // remove the last TD element (padding)
            $("table.ms-wikitoolbar tbody tr td.ms-toolbar[width]:last").remove();
 
            // now build a link
            var $select = "<a href='" + wikiHome + "' class='ms-toolbar'>Wiki Home<a>";
 
            // add a separator pipe, append the link and then the padding
            $parent.append($tdSeparator).append("<td class='ms-toolbar' nowrap>" +
            $select + "</td>").append($tdLastCell);
        }
    }
 
    jQuery.event.add(document, "ready", addWikiHomeButton);
</script>

.

Labels: , ,

Automatically add ‘Search As You Type’ to every SharePoint page using Infuser

Posted at: 5:10 PM on 30 July 2009 by Muhimbi

Inject some goodies into your site It’s only been a day since we launched our free Infuser tool  and we already have an excellent application for it; Add Search as you Type support to SharePoint’s standard search box.

As many of you will be aware, Jan Tielens created a proof of concept some time ago to demonstrate how you could add this functionality to a custom web part. Very innovative, but unfortunately it has a couple of problems, most notably:

  • The script has to be added manually to every page on the site, which is very laborious and not always possible.
     
  • It doesn’t integrate with the standard MOSS search box, leaving the end user with two search boxes to choose from.
     
  • If the user doesn’t have access to the root site of the portal then search doesn’t work.
     
  • Resizing the window with the search results causes undesired effects.
     
  • The search button is present, but doesn’t work.
     
  • It is not clear how to make the search results window disappear.
     
  • It relies on the MOSS Search web service and doesn’t work with WSS.  
     
    Although Jan’s script works without modification in Infuser, we asked Jan’s permission and spent a couple of hours to address the points listed above with the exception of WSS compatibility, feel free to add this yourself. The full source code is listed at the end of this article.
     

SearchAsYouType

 
Follow the steps outlined below to add Search as you Type to your site collection:

  1. Download and install Muhimbi’s SharePoint Infuser on one of your Web Front End Servers.
     
  2. Ensure you have Designer privileges, more specifically the Add and Customize Pages right.
     
  3. From the Site Actions / Site Settings screen, select Infuse custom content in the Look and Feel column.
     
  4. Download the code and paste it into the Infuser window. If copying from the window below and you are using IE then you may want to paste it in WordPad first , otherwise all line breaks are stripped out.
     
  5. Click the Save button and navigate to any page that contains a search box and start typing.
     
<style type="text/css">
    /* Hide the search scope fields as we don't take their input */
    .ms-sbscopes          {display:none}   /* MOSS */
    #idSearchScope        {display:none}   /* WSS */
 
    .quickSearchResultDivUnselected
    {
        background: white;
        border: 1px solid white;
        margin-left: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .quickSearchResultDivSelected
    {
        background: #EEEEEE;
        border: 1px solid Gray;
        margin-left: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
</style>
 
<!-- Load the JQuery Libraries that ship with Infuser -->
<script type="text/javascript" src="/_layouts/Muhimbi.Infuser/JQuery/jquery-1.3.2.min.js"></script>
 
<script type="text/javascript">
    // QuickSearch v0.2
    // Created by Jan Tielens, http://weblogs.asp.net/jan
    // Modified to integrate with standard Seachbox by www.muhimbi.com
    // This sample code is provided on an “as is” basis and without warranty of any kind.
 
    // *** Customizable parameters ***
    var quickSearchConfig = {
        delay: 500,             // time to wait before executing the query (in ms)
        minCharacters: 3,       // minimum nr of characters to enter before search
        scope: "All Sites",     // search scope to use 'All Sites'
        numberOfResults: 15,    // number of results to show
        resultsAnimation: 200// animation time (in ms) of the search results
        resultAnimation: 0      // animation time (in ms) of individual result (when selected)
    };   
 
    var quickSearchTimer;
    var quickSearchSelectedDivIndex = -1;
    var searchBox = null;
 
    // ** Hook up the various events 
    jQuery.event.add(window, "resize", resizeWindow);
    jQuery.event.add(document, "click", hideResultsDiv);
 
    $(document).ready(function() {
        // ** The searchbox uses a dynamic ID so select it by class     
        searchBox = $('.ms-sbplain');
 
        // Muhimbi, insert the results box after te search area
        searchBox.after("<div id=\"quickSearchResults\" style=\"display: none; z-index:1000\"></div>");
 
        searchBox.keyup(function(event) {
            var previousSelected = quickSearchSelectedDivIndex;
 
            // catch some keys
            switch(event.keyCode) {
                case 13:    // enter
                    var selectedDiv = $("#quickSearchResults>div:eq(" + quickSearchSelectedDivIndex + ") a");
                    if(selectedDiv.length == 1)
                        window.location = selectedDiv.attr("href");
                    break;
                case 38:    // key up
                    quickSearchSelectedDivIndex--;
                    break;
                case 40:    // key down
                    quickSearchSelectedDivIndex ++;
                    break;
            }
 
            // check bounds
            if(quickSearchSelectedDivIndex != previousSelected) {
                if(quickSearchSelectedDivIndex < 0)
                    quickSearchSelectedDivIndex = 0;
                if(quickSearchSelectedDivIndex >= $("#quickSearchResults>div").length -1)
                    quickSearchSelectedDivIndex = $("#quickSearchResults>div").length - 2;               
            }
 
            // select new div, unselect the previous selected
            if(quickSearchSelectedDivIndex > -1) {
                if(quickSearchSelectedDivIndex != previousSelected) {
                    unSelectDiv( $("#quickSearchResults>div:eq(" + previousSelected + ")"));
                    selectDiv($("#quickSearchResults>div:eq(" + quickSearchSelectedDivIndex + ")"));
                }
            }
 
            // if the query is different from the previous one, search again
            if($(searchBox).data("query") != $(searchBox).val()) {
                if (quickSearchTimer != null) // cancel the delayed event
                    clearTimeout(quickSearchTimer);
                quickSearchTimer = setTimeout(function() { // delay the searching
                        $("#quickSearchResults").fadeOut(200, initSearch);
                    } , quickSearchConfig.delay);
            }
        });            
    });
 
    function showResultsDiv(text) {
        var div = $("#quickSearchResults");
        resizeWindow();
        div.append(text).slideDown(quickSearchConfig.resultsAnimation);
    }
 
    function hideResultsDiv() {
        var div = $("#quickSearchResults");
        div.slideUp(quickSearchConfig.resultsAnimation);
        div.empty()
    }
 
    function resizeWindow()
    {
        var div = $("#quickSearchResults");
        var searchParent = $(searchBox).parent();
 
        var divCss = {
            "left": searchParent.offset().left,
            "padding": 0,
            "position": "absolute",
            "top": searchParent.offset().top + searchParent.height() + 1,
            "border": "1px solid #7f9db9",
            "width": searchParent.width(),
            "background": "white",
            "max-width": searchParent.width()
            };
 
        div.css(divCss);
    }
 
    function unSelectDiv(div) {
        // first stop all animations still in progress
        $("#quickSearchResults>div>div").stop(true,true);
 
        div.removeClass("quickSearchResultDivSelected").addClass("quickSearchResultDivUnselected"); 
        $("#details", div).hide();
    }
 
    function selectDiv(div) {
        div.addClass("quickSearchResultDivSelected");
        $("#details", div).slideDown(quickSearchConfig.resultAnimation);
    }
 
    function initSearch() {
        // first store query in data
        $(searchBox).data("query", $(searchBox).val());
 
        // clear the results
        $("#quickSearchResults").empty();
 
        // start the search
        var query = $(searchBox).val();
        if(query.length >= quickSearchConfig.minCharacters) {
            showResultsDiv("Searching ..."); // display status
            search(query);
        }
    }
 
    function search(query) {
        quickSearchSelectedDivIndex = -1;
        var queryXML =
            "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'> \
            <Query domain='QDomain'> \
             <SupportedFormats> \
                <Format>urn:Microsoft.Search.Response.Document.Document</Format> \
             </SupportedFormats> \
             <Context> \
              <QueryText language='en-US' type='STRING' >SCOPE:\"" +
                 quickSearchConfig.scope + "\"" + query + "</QueryText> \
             </Context> \
             <SortByProperties> \
               <SortByProperty name='Rank' direction='Descending' order='1'/> \
             </SortByProperties> \
             <Range><StartAt>1</StartAt><Count>" + quickSearchConfig.numberOfResults + "</Count></Range> \
             <EnableStemming>false</EnableStemming> \
             <TrimDuplicates>true</TrimDuplicates> \
             <IgnoreAllNoiseQuery>true</IgnoreAllNoiseQuery> \
             <ImplicitAndBehavior>true</ImplicitAndBehavior> \
             <IncludeRelevanceResults>true</IncludeRelevanceResults> \
             <IncludeSpecialTermResults>true</IncludeSpecialTermResults> \
             <IncludeHighConfidenceResults>true</IncludeHighConfidenceResults> \
            </Query></QueryPacket>";
 
        var soapEnv =
            "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" +
            " xmlns:xsd='http://www.w3.org/2001/XMLSchema' \
              xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
              <soap:Body> \
                <Query xmlns='urn:Microsoft.Search'> \
                  <queryXml>" + escapeHTML(queryXML) + "</queryXml> \
                </Query> \
              </soap:Body> \
            </soap:Envelope>";
 
        $.ajax({
            url: L_Menu_BaseUrl + "/_vti_bin/search.asmx",
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            complete: processResult,
            contentType: "text/xml; charset=\"utf-8\""
        });
 
        function processResult(xData, status) {
            var html = "";
            $(xData.responseXML).find("QueryResult").each(function() {
                var divWidth = $(searchBox).parent().width() + 20;
 
                var x = $("<xml>" + $(this).text() + "</xml>");
                x.find("Document").each(function() {
                    var title = $("Title", $(this)).text();
                    var url = $("Action>LinkUrl", $(this)).text();
                    var description = $("Description", $(this)).text()
 
                    html +=
                        "<div class='quickSearchResultDivUnselected' style='width:" + divWidth +
                              "px;max-width:" + divWidth +"px'> \
                            <a href=\"" + url + "\">" + $("Title", $(this)).text() + "</a> \
                            <div style='display:none' id='details' style='margin-left:10px'>"
                                + description +
                                "<br/>" + url + " \
                            </div> \
                        </div>";
                });
                if(x.find("TotalAvailable").text() != "")
                    html += "<div style='text-align:center; width:" + divWidth +
                            "px'>Total results: " + x.find("TotalAvailable").text() + "</div>";
                else                       
                    html += "<div style='text-align:center; width:" + divWidth +
                            "px'>Total results: 0</div>";
            });
 
            $("#quickSearchResults").empty().append(html);
            $("#quickSearchResults>div>a").hover(
                function() { selectDiv($(this).parent()); },
                function() { unSelectDiv($(this).parent());  }
            );                   
            showResultsDiv();
        }           
    }
 
    function escapeHTML (str) {
       return str.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
    }
</script>

.

Labels: , ,

‘Massage’ SharePoint into submission using Muhimbi’s SharePoint Infuser

Posted at: 5:33 PM on 29 July 2009 by Muhimbi

InfuserBox

They say Great things come in small packages and Simple solutions are often the best. In case of our new, and completely free product, we humbly agree.

SharePoint Infuser’s concept is simple. It allows custom content, any content, to be inserted automatically on every page in a site collection. Big deal you may think, I can do that easily via SharePoint Designer / Customer Master Page / Content Editor Web Part, Delegate Controls etc. All I need to do is spec it out, develop it, put it through testing, put it past infrastructure, sweet talk the change control guy and my manager…. Yes, easy indeed.

And indeed, some people may prefer to roll their own solution, which is not necessarily always a bad idea. Meanwhile the rest of us may want to make changes that can be measured in minutes rather than days, or more likely, weeks.

In essence Infuser is used in a similar manner to the many existing Content Editor Web Part (CEWP) ‘hacks’ such as Jan Tielens’ cool hacks, End User SharePoint’s many articles and ContentEditorWebPart.com. The main difference is that the CEWP must be added manually to every page in the site - which is a pain and doesn’t scale – whereas Infuser inserts the code automatically on every page in the Site Collection.

The best way to show the power of Infuser is by example. In addition to the examples listed below we will publish many more over the next few weeks, so subscribe to our RSS feed, Twitter Stream or Newsletter.

 

Example 1 – Hide unnecessary user interface elements

Sometimes less is better, which is why it may be a good idea to hide user interface elements that your users have no need for, or quite frankly would confuse them. In the following example we will hide the ‘View all Site Content’ and ‘Search Scope Picker’ from every page in the site collection as visualised in the following ‘before & after’ screenshots.

Example1


Follow the steps outlined below to implement the changes:

  1. Download and install Muhimbi’s SharePoint Infuser on one of your Web Front End Servers.
     
  2. Ensure you have Designer privileges, more specifically the Add and Customize Pages right.
     
  3. From the Site Actions / Site Settings screen, select Infuse custom content in the Look and Feel column.
     
  4. Insert the following style sheets:

    <style>
       .ms-quicklaunchheader {display:none}
       .ms-sbscopes          {display:none}   /* MOSS */
       #idSearchScope        {display:none}   /* WSS */
    </style>

     
  5. Click the Save button and navigate to any page that was previously displaying the Search Scope Picker.
InfuserScreenShot1

 

Example 2 – Collapse the Quick Launch menu

Let’s continue with a slightly more complex example that inserts a small section of JavaScript in every page in order to collapse the individual items in the Quick Launch Menu.

Example2


Follow the steps outlined below to implement the changes:

  1. Download and install Muhimbi’s SharePoint Infuser on one of your Web Front End Servers.
     
  2. Ensure you have Designer privileges, more specifically the Add and Customize Pages right.
     
  3. From the Site Actions / Site Settings screen, select Infuse custom content in the Look and Feel column.
     
  4. Copy and paste the code from this End User SharePoint posting.
     
  5. Click the Save button and navigate to any page that displays the Quick Launch Menu.
     

Example 3 – Let it snow

Finally, and most importantly, a real Enterprise Ready example: Snow!…. Yes snow on every page of your SharePoint site, why not.

Follow the steps outlined below to add this marvellous winter wonderland.

  1. Download and install Muhimbi’s SharePoint Infuser on one of your Web Front End Servers.
     
  2. Ensure you have Designer privileges, more specifically the Add and Customize Pages right.
     
  3. From the Site Actions / Site Settings screen, select Infuse custom content in the Look and Feel column.
     
  4. Manually insert “<script></script>” in the Infuser window and paste the code in snowstorm.js in between.
     
  5. Update line 75 (see how cool the line numbers in our editor are) to:
     
    var imagePath = 'http://www.schillmania.com/projects/snowstorm/image/snow/';
     
  6. Click the Save button and navigate to any page in the site collection.

 

Bonus Examples

We created a couple of follow up articles:

 

In closing

The possibilities are endless. If it can be done in the Content Editor WebPart then it can most likely be done more efficiently using SharePoint Infuser.

So, if  your IT team doesn’t allow you to make changes, is too busy, your changes are not a priority or if you are hosting your SharePoint site externally and you are not allowed to install your own modifications then SharePoint Infuser is most likely the best option you have to modify the look and feel of your SharePoint site.

We are currently working with a number of hosting providers to ensure Infuser is installed by default on all systems, allowing all their customers to benefit from it.

Note that we ship with JQuery (1.3.2-min) out of the box. It can be found at “/_layouts/Muhimbi.Infuser/JQuery/jquery-1.3.2.min.js”

For more information check out the:

As always, feel free to contact us using Twitter, our Blog or regular email or subscribe to our newsletter.

 

Download your complete free, no strings attached, copy here (1MB).

You don’t even have to register, but we would appreciate it if you did.

Labels: , , ,