7/19/14

Change SharePoint ms-core-brandingtext with JavaScript

A quick note about this task is that you can rename the SharePoint site brand name with SharePoint Management PowerShell to avoid having to use this approach. When we do not have access to PowerShell, we can do this with some JavaScript on the site’s master page. We should use SharePoint 2013 Designer for this change.

We first need to identify the master page that our site is using. We then need to find the HTML element that contains the site brand name. For SharePoint 2013, the brand name is contained in the following HTML element:

<div class="ms-core-brandingText">SharePoint</div>

On the master page, this is generated from a server side control with this mark up:

<SharePoint:DelegateControl id="ID_SuiteBarBrandingDelegate" ControlId="SuiteBarBrandingDelegate" runat="server" />

We need to just change the HTML that is rendered on the client side. We can quickly do this by scrolling to the end of the master page and entering our JavaScript snippet to change the text on that HTML element.

<sharepoint:scriptblock runat="server">

try{
   document.querySelectorAll('div.ms-core-brandingText')[0].innerHTML = 'All About .NET';
}catch(e){}
</sharepoint:scriptblock>

The snippet is selecting all the div elements with the ms-core-brandingText class. There should only be one element with that class name. We then just set the innerHTML to the text that we need. Make the change, save the master page, and refresh the site. It should now look like this:


A drawback about this is that it needs to be done in each master page that your site is using and for each sub-site.


I hope this helps.

5 comments :

  1. Wonderful information, I had come to know about your blog from my friend, and let me tell you, your website gives the best and the most interesting information. This is just the kind of information that I had been looking for, I'm already your rss reader now and I would regularly watch out for the new posts, once again hats off to you! Thanks a ton once again, Regards, Best SharePoint Administration Training in Hyderabad India

    ReplyDelete
  2. Excellent piece of information, I had come to know about your website from my friend, and let me tell you, your site gives the best and the most interesting information. This is just the kind of information that I had been looking for, I'm already your rss reader now and I would regularly watch out for the new posts, once again hats off to you! Thanks a lot once again, Regards, Best SharePoint Developer Training in Hyderabad India

    ReplyDelete
  3. Brilliant piece of information, I had come to know about your web-page from my friend, and let me tell you, your webpage gives the best and the most interesting information. This is just the kind of information that I had been looking for, I'm already your rss reader now and I would regularly watch out for the new posts, once again hats off to you! Thanks a million once again, Regards, Best SharePoint Online Training in Hyderabad India

    ReplyDelete
  4. Too good piece of information, I had come to know about your site from my friend, and let me tell you, your web-page gives the best and the most interesting information. This is just the kind of information that I had been looking for, I'm already your rss reader now and I would regularly watch out for the new post, once again hats off to you! Thanks a lot once again, Regards, Best SharePoint Training Institutes in Hyderabad India

    ReplyDelete
  5. There are a fabulous a bit distinctive procedure, even so the collection unsecured personal possession plus 12 o'clock hour or so marker exist together with whole. It is always either legible and even strong with a sort of exquisite mode http://www.hotreplicaonline.com. The result can be deeper waterproof to be able to 100 yards plus the black colored straps can be calfskin leather-based which has a great essentially fabric look for ways to it. My partner and i have no idea as to why typically the see insists regarding wrist watches for this character staying constrained variant styles. They are simply not really for that get together and / or trigger and do not actually characterize brand new systems.

    ReplyDelete

What do you think?