November Happy Hour will be moved to Thursday December 5th.

Disable Format Paragraph drop down in Editor

Vote:
 

Hi.

Is it posible to disable the Format Paragraph drop down list in the editor?  I have made a property that inherits from PropertyLongString. I have overriden the EditorToolOptions property and set it to return this:

public override EditorToolOption EditorToolOptions
{
get { return EditorToolOption.Undo | EditorToolOption.Redo | EditorToolOption.SpellCheck | EditorToolOption.Refresh | EditorToolOption.Find; }
set { base.EditorToolOptions = value; }
}
It works fine. I only get the EditorToolOptions that is specified, but I also get the Format Paragraph drop down. Why is this?!
I bellive that this line of code from PropertyLongStringControl is causing this:
protected virtual WebControl CreateHtmlEditor()
{
editor.ContentCssFile = this.GetCssPaths();
}

I could make a own propertycontrol class that inherits from PropertyLongStringControl and override GetCssPaths, but does it have to be that diffucult?!
Br, Tore 
#31212
Jul 09, 2009 8:13
Vote:
 

It seems the FormatParagraph tool isn't configurable. I can't see any reason why it shouldn't be configurable like the other tools so I've filed a bug report.

Unfortunately I can't provide any information that solves your problem in an easy way.

/Stefan
#31231
Jul 10, 2009 11:33
Vote:
 

Hi Stefan.

Thanks for your answer.  I solved by overrideing the GetCssPaths method in the PropertyLongStringControl. I still get the "Remove formatting" option in the dropdown, but all the other options are removed

Here is the code if others have the same problem:

MyProperty.cs

[Serializable]
[PageDefinitionTypePlugIn]
public class MyProperty : PropertyLongString
{
public override IPropertyControl CreatePropertyControl()
{
return new MyPropertyControl();
}

public override EditorToolOption EditorToolOptions
{
get { return EditorToolOption.Undo | EditorToolOption.Redo | EditorToolOption.SpellCheck | EditorToolOption.Refresh | EditorToolOption.Find; }
set { base.EditorToolOptions = value; }
}
}

MyPropertyControl.cs

public class MyPropertyControl : PropertyLongStringControl
{
protected override string GetCssPaths()
{
return string.Empty;
}
}

Br, Tore

#31233
Jul 10, 2009 13:05
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.