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

rss

Posted by eedoh - Feb 24 ’14 at 04:50

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

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 10 months 26 days
    #1 by Dmitry Kozlov Feb 25 ’14 at 02:33

    Please, put the following code into JS-editor of Forms Designer:

    $('.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.

  • eedoh
    Member
    Member for: 5 years 6 months 17 days
    #2 by eedoh Feb 25 ’14 at 10:55

    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

  • eedoh
    Member
    Member for: 5 years 6 months 17 days
    #3 by eedoh Feb 25 ’14 at 02:04

    I figured it out. Needed to add .eq(number) to it

     

    $('.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');
    });
  • Murray
    Member
    Member for: 5 years 5 months 29 days
    #4 by Murray May 29 ’15 at 09:10
    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
Displaying 1 to 4 of 4 messages