Change "new discussion" label in a SharePoint Discussion Board - Fabian Neve

About SharePoint, Javascript, PowerShell, and other technical stuff

Wednesday, January 17, 2018

Change "new discussion" label in a SharePoint Discussion Board

It is unfortunately not possible to change the "+ new discussion" label out of the box. This wouldn't be a problem if you use this app only as a discussion board. What if you want to have an advanced "News"-Stream, where the readers must be able to comment the news? Or an eBay-like marketplace? Therefore, a "new discussion" wouln't be appropriate, it has to be something like "Create News" or "New Offer".


Herefore you can change the label using JavaScript. Insert a script editor webpart into the Category.aspx page and use following script:

//self-executing anonymous function
(function () {
// String overrides
function DiscussionListViewStringOverride() {
Strings.STS.L_SPDiscHeroLinkAltText = "New Label"; //change "New Label" into your desired one, eg. "Create News"
Strings.STS.L_SPDiscHeroLinkFormat = "New Label"; //change "New Label" into your desired one, eg. "Create News"
}
DiscussionListViewStringOverride();
ExecuteOrDelayUntilScriptLoaded(DiscussionListViewStringOverride, "strings.js");
})();


This script was tested with SharePoint 2013 and SharePoint 2016.

Source: StackExchange.com

No comments:

Post a Comment