0

I want to trim the options down to just a few basic options like bold, underline, and italic . How do I remove unwanted buttons from the Rich Text Editor (font button, color button etc)?

I'm thinking I can do this somehow with JavaScript and CSS.

enter image description here

1

With SharePoint Designer, in the option of the column you can disable "Rich Text". Or, in the list configuration, you can access de column options.

0

I've implemented the same thing a couple of days ago. The way I've done this was:

  1. Create a control (don't forget to add a safe control entry for it):

    <Control ControlAssembly="$SharePoint.Project.AssemblyFullName$" ControlClass="Project.CustomActions.Control1" Sequence="1000" Id="AdditionalPageHead"> </Control>

I needed this in the page edit mode. Your requirements might be different. If it's a new form, consider adding a custom action instead of a control:

<CustomAction Id="Project.CustomActions.CustomAction1Id" Location="CommandUI.Ribbon" Sequence="1" ControlAssembly="$SharePoint.Project.AssemblyFullName$" ControlClass="Project.CustomActions.CustomAction"> </CustomAction>

  1. Handle OnLoad event in the control class. The class needs to implement a WebControl class:

       protected override void OnLoad(EventArgs e)
       {
        this.EnsureChildControls();
        base.OnLoad(e);
        this.Visible = false;
    
        if (Microsoft.SharePoint.SPContext.Current.FormContext.FormMode == SPControlMode.Edit)
        {
            SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
            HideCustomActions(ribbon);
        }
    }
    
  2. Hide custom actions:

    ribbon.TrimById(buttonToTrim);

You can get the IDs of the Ribbon buttons using IE developer tool (F12): enter image description here

P.S - Stackexchange's code formating options are ridicullous.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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