lundi 1 décembre 2014

Options to modify a RichTextEdtitor



Due to my current research I collected the options to alter the modifying options. Do you know other ways to change the RTE?


1. Modify the attributes inline (all attributes)


<PublishingWebControls:RichHtmlField AllowThemeFonts="false" AllowTableStyles="false" AllowTables="false" AllowStyles="false" AllowStandardFonts="false" AllowLists="false" AllowInsert="false" AllowImageStyles="false" AllowImages="false" AllowImagePositioning="false" AllowImageFormatting="false" AllowHyperlinks="false" AllowHtmlSourceEditing="false" AllowHeadings="false" AllowFontStandardColors="false" AllowFontThemeColors="false" AllowFontsMenu="false" AllowFontSizesMenu="false" AllowParagraphFormatting="false" AllowTextMarkup="false" AllowFonts="false" FieldName="PublishingPageContent" runat="server"/>


Pro


-No serverside code


Contra


-every control needs to be altered


-need of modified pagelayout versions




2. Modify attributes serverside


Add code to every page (e.g. AdditionalPageHead) that checks for the control type and alters all instances of that control.


Example


Pro


-no need to modify pagelayouts


Contra


-serverside code


3. Modify attributes clientside (JS)


I found out that you can access the same attributes as mentioned in 1. via JS. I did not test every single one, but at least most of them work if set via JS.



function setRichText(){
$(".ms-rtestate-write.ms-rtestate-field").each(function(){
this['PrefixStyleSheet'] = "dp-";
this['AllowTextMarkup'] = "FALSE";
this['AllowTableStyles'] = "FALSE";
this['AllowTables'] = "FALSE";
this['AllowStyles'] = "FALSE";
this['AllowStandardFonts'] = "FALSE";
this['AllowLists'] = "FALSE";
this['AllowImagePositioning'] = "FALSE";
this['AllowImageFormatting'] = "FALSE";
this['AllowHyperlinks'] = "FALSE";
this['AllowHtmlSourceEditing'] = "FALSE";
this['AllowHeadings'] = "FALSE";
this['AllowFontStandardColors'] = "FALSE";
this['AllowParagraphFormatting'] = "FALSE";
this['AllowTextMarkup'] = "FALSE";
this['AllowFonts'] = "FALSE";
this['AllowThemeFonts'] = "FALSE";
});
}


Pro


-no need to modify pagelayouts


-no serverside code


Contra


-the initial opened ribbon will not load all attributes correctly. Only if you focus another element and the ribbon is rebuild, the contents will be correct.


-not documented








0 commentaires:

Enregistrer un commentaire