Limit the XHTML string

Vote:
 
Hi. Is there any possibility to restrict the Font type in the XHTML string editor? My customer wants it default to be Verdana 10, and it should not be possible to change and use other font types like Heading1, Heading2 and so on. BR, Tore
#12833
Mar 25, 2008 18:35
Vote:
 
Turn off the font tool for the editor for the page type. That will limit the editors to only use styles. I think this is explained in the edit and/or admin manuals.
#14953
Mar 25, 2008 18:46
Vote:
 
Hi. Thanks for the answer. I have disabled the font tool, but still there is a drop down box with Heading1, Heading2, etc... Any ideas? BR, Tore
#14954
Mar 25, 2008 18:46
Vote:
 
Oh, I assumed... eh... bummer. Ok, you then have two options: 1. If you want to remove this for all the wysiwyg editors, you can disable the control in admin. Under the Config tab, select the Plug-in Manager, click EPiServer (at the bottom), click Overview tab, un-tick Format Paragraph. 2. If you need to control this in a more detailed manner, you have to "hack" it. The drop-down is rendered by the insertStyleSheetDropdownItems function in the Util\javascript\Editor\PasteUnformatted.js file. As an example, if you insert the following at line 344: tool.style.display = 'none'; you will remove the drop-down for all editors. You could add a test to check the name of the editor (thus the name of the property), etc. Note! The last option is unsupported, and you're editing a system file, which could be dangerous. But, it is possible. /Steve
#14955
Mar 25, 2008 18:46
Vote:
 
Hi Steve. I will try that in the morning. Thanks for your help! BR, Tore
#14956
Mar 25, 2008 18:46
Vote:
 
I think the styles in the dropdown are set by adding a dummy attribute, 'EditMenuName' in the Editor.css stylesheet. I haven't tried it, but I'd assume that removing these attributes will remove the entries from the drop-down - if that works it's got to be better than hacking javascript!
#14957
Mar 25, 2008 18:46
Vote:
 
Good point. Beats hacking javascript! However, disabling the tool in the plug-in manager will also remove the dropdown and the toolbar altogether, they won't consume any space in the UI. Not sure if removing all the EditMenuName attributes will accomplish the same (should be an easy thing to test.) /Steve
#14958
Mar 25, 2008 18:46
Vote:
 
Thank you for your answers guys. This will for sure solve my problem. But the how do I set the default style to be Verdana 10? Do I set this by setting the

in the stylesheet to be font-size: 10px; ? BR, Tore

#14959
Mar 25, 2008 18:46
Vote:
 
The styles that govern the wysiwyg editor are defined in the stylesheet pointed to in the web.config file, under the EPsEditCSS key. By default it is: If you change this to set the body, p and/or div tags to be Verdana 10px, you should be fine. Btw. using px is not a good WAI practice. As a side note, you do not actually need to use this very same stylesheet on the site for the visitors. The EditMenuName style attribute that EPiServer uses for the style drop down does not validate. You could have a valid css file that looks just the same as the one loaded by the editor, but without the EditMenuName attribs. Just make sure you remember to update both ;-)
#14960
Mar 25, 2008 18:46
Vote:
 
Hi Steve. Thank you for your answers. I`ll try it first thing in the morning! BR, Tore
#14961
Mar 25, 2008 18:46
* 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.