0

I need to change the display name of one of my lists, which is showing in the site contents. I'm deploying it from my visual studio project.

eg. My list's name is "TermsOfUse". I need to retain the same name, but it should display to the user as "Terms Of Use for Web API" in site contents.

Is it possible to change the display name without changing the original name ?

4
  • Do you want to do it in Visual Studio?
    – Sudhakar
    Jul 16, 2014 at 10:11
  • Yes. I'm creating the list via Visual Studio.
    – Anish V
    Jul 16, 2014 at 10:15
  • I was just thinking you can change the display name of the list in title field from the list settings.
    – Sudhakar
    Jul 16, 2014 at 10:19
  • I've tried that, but not working!
    – Anish V
    Jul 16, 2014 at 10:20

3 Answers 3

2

Go to your Elments.xml of the list instance/definition and change the Title. ex.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Title="Terms Of Use for Web AP"
              OnQuickLaunch="TRUE"
              TemplateType="109"
              FeatureId="00bfea71-52d4-45b3-b544-b1c71b620109"
              Url="Lists/TermsOfUse"
              Description="My List Instance">
</ListInstance>

0
1

If you want to retain the same display name, but just change how the name is displayed in Site Contents, I suggest that you do a little jQuery hack.

var termsOfUseLink = $('#applist a.ms-vl-apptitle[title="TermsOfUse"]');
$(termsOfUseLink).text("Terms Of Use for Web API");

Of course you need to make sure that jQuery is referenced, you also need to include your javascript. Make sure your code is executed when the page has loaded completely:

$(document).ready(function() {
  // code goes here
});

Include both javascript files (jQuery and your code) in your solution using a Custom Action (EDIT: TWO Custom Actions) with ScriptLink attribute.

In order for the code not to be executed on every page, just the Site Contents, place the code inside this statement:

if ((window.location.href.toLowerCase().indexOf("viewlsts.aspx") > -1) && window.location.href.toLowerCase().indexOf("_layouts/15") > -1) {

}

Hope this helps.

6
  • Thanks for your reply. But, I was looking to do it without using jQuery.
    – Anish V
    Jul 21, 2014 at 5:34
  • I am sorry but this is the only solution that works according to the requirements that you specify. You want to retain the same name of the list, but you want a different name to be displayed to the user, only on the site contents page. There is no way to do this without using jQuery. The answer that you marked as accepted answer does not fulfill your requirements. Jul 21, 2014 at 8:28
  • Can you explain why the marked answer is wrong ? I'm able to change the title shown in Site Contents by modifying the List Instance elements.xml file.
    – Anish V
    Jul 21, 2014 at 10:04
  • Because, as I wrote before, as you state your requirements, you want to retain the same name of the list, but you want a different name to be displayed to the user, only on the site contents page. The answer that you marked as accepted answer does not fulfill your requirements. Jul 21, 2014 at 11:55
  • But, I was able to change the list's title shown in site contents by changing the title in list's instance. This has fulfilled my requirement too.
    – Anish V
    Jul 22, 2014 at 7:05
0

If you just want to change the name in left menu, just go to Site Settings > Quick Start and edit the name as you wish. Quick Start

1
  • I'm not able to find this menu. Can you show the english version ? Also, I need to do it using Visual Studio or its schema.xml file.
    – Anish V
    Jul 16, 2014 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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