Remove SharePoint Webpart title link so that it does not drill down to the underlining list

There are many options you can take to remove the Title link. It depends upon whether you would like to keep every out of box or prefer to use Javascript.

Option 1:
Add an empty content editor webpart and give same title as listview webpart, and on the listview webpart you have to set the chrome to none so title doesn't display once you exit out of design mode.

You can modify Chrome Type property of the List View Webpart:

  • Site Action
  • Edit Page
  • From the context menĂ¹ on the top-right of the webpart choose Edit Web Part
  • Within the properties pane expand Appareance section
  • Modify the property Chrome Type to None or Border Only
  • Click Ok
  • Click on Stop Editing button





Option 2:
If you put a pound "#" in the Title URL you get a link to current page.

You can modify Chrome Type property of the List View Webpart:

  • Site Action
  • Edit Page
  • From the context menĂ¹ on the top-right of the webpart choose Edit Web Part
  • Edit the list view webpart
  • Expand the Advanced tab, and replace the title url with #
  • Click on Apply button
  • Click on Stop Editing button




Option 3: Javascript
Add a script editor webpart on the page, and add the following Javascript code. This code will disable all Webparts Title link on the page.

<script>
$(function() {
    $('.ms-webpart-titleText').each(function() {
        var link = $(this).find('a');
        if (link.length > 0)
            $(this).text(link.text());
    });
});
</script>

Option 4: Javascript
Add a script editor webpart on the page, and add the following Javascript code. This code will disable only specific Webpart Title link on the page.

<script>
$( document ).ready(function() {
    $('a[href="/sites/yoursitename/Lists/yourlistname"]').contents().unwrap();
});
</script>

No comments: