Class TinyMceSettings
Configuration options from TinyMCE.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Cms.TinyMce.Core
Assembly: EPiServer.Cms.TinyMce.dll
Version: 2.13.4Syntax
public class TinyMceSettings : Dictionary<string, object>, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IDictionary, ICollection, IReadOnlyDictionary<string, object>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable, ISerializable, IDeserializationCallback
Properties
PluginSettingsTransforms
A list of all setting transformations registered for the plugins in this instance
Declaration
public IDictionary<string, SettingsTransform> PluginSettingsTransforms { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, SettingsTransform> |
SettingsTransforms
A list of all setting transformations registered for this instance
Declaration
public IDictionary<string, SettingsTransform> SettingsTransforms { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, SettingsTransform> |
Methods
AddExternalPlugin(String, String)
Add an external plugin
Declaration
public TinyMceSettings AddExternalPlugin(string pluginName, string pluginPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginName | Plugin name |
System.String | pluginPath | An absolute path to the plugin definition file. |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
AddExternalPlugin(String, String, SettingsTransform)
Add an external plugin
Declaration
public TinyMceSettings AddExternalPlugin(string pluginName, string pluginPath, SettingsTransform transform)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginName | Plugin name |
System.String | pluginPath | An absolute path to the plugin definition file. |
SettingsTransform | transform | The transformation to run, it will be called with the current TinyMceSettings, EPiServer.Core.IContent and the property name |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
AddPlugin(String)
Add plugin to plugins list
Declaration
public TinyMceSettings AddPlugin(string pluginName)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginName | The name of the plugin |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
AddPlugin(String, SettingsTransform)
Add plugin to plugins list
Declaration
public TinyMceSettings AddPlugin(string pluginName, SettingsTransform transform)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginName | The name of the plugin |
SettingsTransform | transform | The transformation to run, it will be called with the current TinyMceSettings, EPiServer.Core.IContent and the property name |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
AddPlugin(String[])
Add plugins to plugins list
Declaration
public TinyMceSettings AddPlugin(params string[] plugins)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | plugins | List of plugins to be added |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
AddSetting(String, Object)
Adds a setting to this TinyMceSettings instance.
Declaration
public TinyMceSettings AddSetting(string key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The setting key (e.g. "external_plugins"). Prefer to use a specific method if it exists (e.g. BodyClass(String)). |
System.Object | value | The setting value. |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
AddSettingsTransform(String, SettingsTransform)
Add a transform action that will run when the settings is received for a specific EPiServer.Core.IContent instance
Declaration
public TinyMceSettings AddSettingsTransform(string name, SettingsTransform transform)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the transformation |
SettingsTransform | transform | The transformation to run, it will be called with the current TinyMceSettings, EPiServer.Core.IContent and the property name |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
AppendToolbar(String, Int32)
Add
Declaration
public TinyMceSettings AppendToolbar(string pluginName, int toolbarIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginName | Plugin name |
System.Int32 | toolbarIndex | Toolbar index |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Exceptions
Type | Condition |
---|---|
System.IndexOutOfRangeException | Thrown when |
BlockFormats(String)
Sets custom block formats
Declaration
public TinyMceSettings BlockFormats(string blockFormats)
Parameters
Type | Name | Description |
---|---|---|
System.String | blockFormats | The block formats to set |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
BodyClass(String)
CSS class for body of the editor
Declaration
public TinyMceSettings BodyClass(string bodyClass)
Parameters
Type | Name | Description |
---|---|---|
System.String | bodyClass |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
ClearPlugins()
Clears the plugins list
Declaration
public TinyMceSettings ClearPlugins()
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Clone()
Clones an new instance of TinyMceSettings.
Declaration
public TinyMceSettings Clone()
Returns
Type | Description |
---|---|
TinyMceSettings |
ContentCss(String[])
Extend css into the editable area
Declaration
public TinyMceSettings ContentCss(params string[] contentCss)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | contentCss |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
DisableMenubar()
Disable the menu bar
Declaration
public TinyMceSettings DisableMenubar()
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
DisableToolbar()
Disable the toolbar
Declaration
public TinyMceSettings DisableToolbar()
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Height(Int32)
Sets width
Declaration
public TinyMceSettings Height(int height)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | height |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
InitializationScript(String)
Add a path to an AMD module that will run on the client when the editor is initialized.
Declaration
public TinyMceSettings InitializationScript(string modulePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | modulePath | the path to the AMD Module, e.g. app/initscript |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Menubar(String)
Set menu bar actions
Declaration
public TinyMceSettings Menubar(string actions)
Parameters
Type | Name | Description |
---|---|---|
System.String | actions | Space separated list of menus |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Plugins(IEnumerable<String>)
Set plugins list
Declaration
[Obsolete("This method has been obsoleted and will be removed in the next major release. Please use AddPlugin and ClearPlugins methods.")]
public TinyMceSettings Plugins(IEnumerable<string> plugins)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | plugins |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Remarks
The SettingsTransform that have been registered for the plugins that will removed will also be removed
Plugins(String[])
Set plugins list
Declaration
[Obsolete("This method has been obsoleted and will be removed in the next major release. Please use AddPlugin and ClearPlugins methods.")]
public TinyMceSettings Plugins(params string[] plugins)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | plugins |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
RawSettings(IDictionary<String, Object>)
Adds or updates settings with the items from the dictionary parameter.
Declaration
public TinyMceSettings RawSettings(IDictionary<string, object> settings)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> | settings |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
RawSettings(String)
Adds or updates settings with the items from the serialized settings JSON string.
Declaration
public TinyMceSettings RawSettings(string json)
Parameters
Type | Name | Description |
---|---|---|
System.String | json | A JSON representation of the settings to be applied. |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
RemoveMenuItems(String)
Remove items from menubar
Declaration
public TinyMceSettings RemoveMenuItems(string actions)
Parameters
Type | Name | Description |
---|---|---|
System.String | actions | Space separated list of menus to remove |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
RemovePlugin(String)
Remove plugin from plugins list and the corresponding SettingsTransform if one has been registered with the given pluginName
Declaration
public TinyMceSettings RemovePlugin(string pluginName)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginName | The name of the plugin |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
RemoveSettingsTransform(String)
Removes a specific SettingsTransform
Declaration
public TinyMceSettings RemoveSettingsTransform(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the name of the transform to remove |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Resize(TinyMceResize)
Sets how the TinyMCE editor can be resized.
Declaration
public TinyMceSettings Resize(TinyMceResize resize)
Parameters
Type | Name | Description |
---|---|---|
TinyMceResize | resize | The resize value. |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Schema(TinyMceSchema)
Schema allows to switch between the HTML4 and HTML5 schema
Declaration
public TinyMceSettings Schema(TinyMceSchema schema)
Parameters
Type | Name | Description |
---|---|---|
TinyMceSchema | schema |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Schema(String)
Schema allows to switch between the HTML4 and HTML5 schema
Declaration
public TinyMceSettings Schema(string schema)
Parameters
Type | Name | Description |
---|---|---|
System.String | schema |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
StyleFormats(Object[])
Sets custom style formats
Declaration
public TinyMceSettings StyleFormats(params object[] styleFormats)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | styleFormats |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Toolbar(String[])
Set the toolbar(s)
Declaration
public TinyMceSettings Toolbar(params string[] toolbar)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | toolbar | The toolbars to set |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |
Width(Int32)
Sets width
Declaration
public TinyMceSettings Width(int width)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width |
Returns
Type | Description |
---|---|
TinyMceSettings | The same instance of TinyMceSettings modified with the new setting. |