locked
rename View Tasks Button in Publish Tab RRS feed

  • Question

  • I want to rename button View Tasks in SharePoint 2010 ribbon. How i can achieve this ?

    for hiding approve or reject button in publish tab i used this code.

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <CustomAction
        Id="RemoveRibbonButton"
        Location="CommandUI.Ribbon">
        <CommandUIExtension>
          <CommandUIDefinitions>
            <CommandUIDefinition
              Location="Ribbon.PublishTab.Publishing.Reject" />
          </CommandUIDefinitions>
        </CommandUIExtension>
      </CustomAction>
    </Elements>

     
    Wednesday, May 21, 2014 9:42 AM

Answers

  • Hi,

    We can use jQuery to achieve it, the following code for your reference:

    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("a[Title='Publish']").click(function(){
                setTimeout(RenameRibbonButton, 100);
            });
        });
        function RenameRibbonButton() {
            var obj=$("a[id='Ribbon.PublishTab.Workflow.ViewTasks-Medium']" );
            obj.html(obj.html().replace("View Tasks","Test"));
        }
    </script>

    Result:

    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Dennis Guo
    TechNet Community Support

    • Marked as answer by JasonGuo Sunday, June 1, 2014 9:51 AM
    Thursday, May 22, 2014 12:55 PM