Page 1 of 1

Is it possible to change Related Items view "Add New Item" link text?

Posted: 24 Feb 2014
by eedoh
I'd like to change "Add new item" link text in Related Items view into something else, but can't find the way of doing that. Is it possible, and if yes, how can I do that??

Thanks

Re: Is it possible to change Related Items view "Add New Item" link text?

Posted: 25 Feb 2014
by Dmitry Kozlov
Please, put the following code into JS-editor of Forms Designer:

Code: Select all

$('.ms-addnew a, .ms-list-addnew span:eq(1)').html('New text');
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() {
    $('.ms-addnew a, .ms-list-addnew span:eq(1)').html('New text');
});
Replace 'New text' with your own text of the new item link.

Re: Is it possible to change Related Items view "Add New Item" link text?

Posted: 25 Feb 2014
by eedoh
This really does change the text, but it changes it in every one (4 of them) of the related items views, and I need it to be changed only on one of them. Any way of restricting this to only one view??

Thanks

Re: Is it possible to change Related Items view "Add New Item" link text?

Posted: 25 Feb 2015
by eedoh
I figured it out. Needed to add .eq(number) to it

Code: Select all

$('.ms-addnew a, .ms-list-addnew span:eq(1)').eq(0).html('New text');
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() {
    $('.ms-addnew a, .ms-list-addnew span:eq(1)').eq(0).html('New text');
});

Re: Is it possible to change Related Items view "Add New Item" link text?

Posted: 29 May 2015
by Murray
Are you able to apply this to the default "Tthere are no items to show in this view...." would it be something like this? $('.ms-listviewtable table td.ms-vb:contains('There are no items'):eq(1)').eq(0).html('Replace'); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() { $('.ms-listviewtable table td.ms-vb:contains('There are no items'):eq(1)').eq(0).html('Replace'); }); This doesn't work but imagine it would be similar to the Add New Item Thanks Murray