Modify Web Part Title using jquery

Markus Kolbeck
Markus' Blog
Published in
2 min readAug 14, 2016

This post describes how to modify a Web Part Title using jquery in SharePoint.

First of all I would like to point out, that I only found a was to “extend” the Web Part title and not to “replace” it. This means, that the existing Web Part title remains and you are able using the following solution to append additional text to the existing title.

Furthermore, I describe a solution that only needs a javascript to be integrated into an existing SharePoint (Web Part) page. No customization of MasterPages etc. are necessary.

Components

The Javascript

You need a little javascript that modifies the Web Part title. In my example I take the value from an URL paramter and append that to the Web Part.

In order to get the Web Part ID of the Web Part you want to modify, you could use e.g. IE Development Tools (F12):
Identify the Web Part and copy the ID that starts with "WebPartCaptionWPQ". The last digit identifies the Web Part.

IE F12 - WebPartCaptionWPQ3

Save the javascript as "ModifyWebPartTitle.txt" within the SharePoint Site, e.g. in the library "Site Assets".

Site Assets - Modify Web Part Title

CEWP

Add a CEWP (Content Editor Web Part) to the Web Part page and configure the properties so that the content will be from the previously saved javascript in the Site Assets library and that the Chrome Type is set to "none" (in order to hide the Web Part).

CEWP - Modofy Web Part Title - Web Part Properties

That's pretty much it.

The Result

Navigate to your SharePoint page and use the URL Paramter you specified as the desired value.

Modify Web Part Title - Result

--

--