SharePoint 2013: Organization Browser Web Part does not render in HTML View for Windows Claims Users
Organization Browser Web Part does not render in HTML View for Windows Claims Users
I have a requirement to display HTML View of Organization Browser in one of the SharePoint Site So I have inserted Organization Browser web part in SharePoint 2013 page and observed that organization hierarchy of the logged-in user is not rendered anything either in HTML View or Silverlight View.
I was searching about this issue in Microsoft sites and figured out one KB article http://support.microsoft.com/kb/2643420 about organization browser issue and saw a fix for Silverlight View in this article but no fix for HTML View. In the same KB article at the bottom of the page, they mentioned about HTML view issue saying “it not possible to overwrite the Html View of the Organization Browser web part from the client”. I am not stopped myself after seeing that message and continued further investigating about HTML View fix.
After some much of R & D, I am successful fixing HTML View issue by overriding the following HTML View function
<script type="text/javascript">
SP.UI.Portal.SimpleProfileBrowser.prototype.$2S_0 = function ($p0, $p1, $p2) {
var i = $p0.indexOf("|");
$p0 = $p0.substr(i+1,$p0.length-i-1);
var $v_0 = $get($p1);
if ($v_0) {
$v_0.innerHTML = '<DIV></DIV><DIV></DIV><DIV></DIV>';
this.$h_0 = $v_0.firstChild;
this.$16_0 = this.$h_0.nextSibling;
this.$1e_0 = this.$16_0.nextSibling;
}
if ($p2) {
this.$h_0.innerHTML = String.format(SpsClient.ScriptResources.silverlight_Install_Message, '<a href=\'javascript:Silverlight.getSilverlight(\"2.0\");\'>Silverlight</a>');
Sys.UI.DomElement.addCssClass(this.$h_0, 'ms-profileBrowserHeaderText');
Sys.UI.DomElement.addCssClass(this.$h_0.firstChild.nextSibling, 'ms-profileBrowserSilverlightLink');
}
this.$2V_0($p0);
}
</script>
Below are the steps to add Organization Browser web part to the page and then adding a HTML View fix to the page.
Steps to add Organization Browser in a SharePoint 2013
- Edit the page
- Click on Insert web part at the top navigation bar
- Go to “Social Collaboration” category and select “Organization Browser” and click on Add button
- Edit the Organization Browser web part and Expand Default Values and check “Only show HTML View” option and click Ok button
Steps to fix HTML View of Organization Browser
- Edit the page (if the page is not in edit mode).
- Click on Insert web part at the top navigation bar
- Go to “Media and Content” category and select “Content Editor” Web Part and click on Add button.
- Edit the content.
- In the Ribbon, click on Edit Source under the Markup tab.
- Copy-paste the code above.
- Hide the Chrome and the content of the web part so that it would not appear on the page.
I am hoping Microsoft will take care of Claims Users issue for Organization Browser web part in the next SharePoint releases..