2

Platform: SharePoint 2016

I added a sitefeed webpart to a sharepoint page and it has a default title of Newsfeed. I tried changing the title to something else but I get an error that says

Unable to set property 'innerHTML' of undefined or null reference

TabHead1MSOZoneCell_WebPartWPQ5 is the ID of my webpart.

Here's the code I have

window.addEventListener('DOMContentLoaded', function() {
alert("HELLO");
document.getElementById("TabHead1MSOZoneCell_WebPartWPQ5").innerHTML = "Community";
})

function changeFeedBackTitle(){
    document.getElementById("TabHead1MSOZoneCell_WebPartWPQ5").innerHTML = "Community News feed";
}
2

Please try below code in Script Editor web part:

<script type="text/javascript">
    window.onload = function () { 
        document.getElementById("ms-currentFeedLabel").innerHTML="Community News feed"; }
</script> 

However there is a click event associate to this link which will undo the changes again to Newsfeed.

Please refer Raghavendra Shanbhag's reply in this post:

https://social.technet.microsoft.com/Forums/sharepoint/en-US/561fe1c1-c747-49b8-9145-de179259d615/change-title-of-newsfeed?forum=sharepointdevelopment

| improve this answer | |
  • that didn't work – OLA Feb 28 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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