10

This problem is best addressed with CSS, where you are trying to control the size of a rendered string, because 100 characters measures a different length depending on what characters they contain. Trite example: 100 x i is a very different size to 100 x W. In the event you're actually doing a "more" break, the best thing is to get content authors to ...


9

Yes you can do it. You can customize the constructor of the EditorConfiguration class: You can use Reflector, IlSpy or .Peek or any disssamble tool to investigate the code. Here is example of the constructor: public EditorConfiguration(Item profile) { Assert.ArgumentNotNull(profile, "profile"); this.Result = new EditorConfigurationResult(); ...


7

Out of the box, you cannot prevent this. It's just the way the RTE works in Sitecore. Fortunately you can work around this issue, but it's a fairly involved process. It involves: Parsing the RTE html for <img> elements with a style attribute, then removing width and height Optionally hooking into the Sitecore renderField pipeline and run the above ...


7

Yes, there is. Go with HtmlAgilityPack.dll. It's already there with your Sitecore site. See here for details: HtmlAgilityPack substring of all by length EDIT Mark commented that this is a link only answer, so I'll copy the code from the linked SO question. Please be aware that it's not my code and all the credits go to Serge Belov public string ...


7

Figured this out... The script that handles in the inline editing of rich text fields in Page Editor is \sitecore\shell\Applications\Page Modes\InlineEditingUtil.js. The code that was causing the specific behavior of inserting a <br> when in the middle of a paragraph is here: if (e.keyCode === 13) { var lineBreakTag = Sitecore.WebEditSettings....


6

I went down this path in this question. To this point I don't think anyone has pulled it off. And its mainly because there is so much Sitecore functionality in the RTE (i.e. Links, photos, etc...) Your best bet it to just allow the editors to have a custom HTML editor similar to what Michael West did. You can wire in your client side editor the same way Mike ...


5

While investigating this issue when I hit it during an upgrade, my debugging discovered that this was caused by a bug in the PortectedImageLinkRenderer class which cannot handle empty <a> tags. In my scenario, I had some HTML in the rich text field as follows: <a>Some Text Here</a> When the pipeline tried to process the 'HREF' tag of the ...


5

From what I remember, the logic responsible for RTE links is in ExpandLinks processor of renderField pipeline: <processor type="Sitecore.Pipelines.RenderField.ExpandLinks, Sitecore.Kernel"/> public virtual void Process(RenderFieldArgs args) { Assert.ArgumentNotNull((object) args, "args"); if (Context.PageMode.IsExperienceEditorEditing) return;...


5

You can remove the rule validation on the Global Rules item /sitecore/system/Settings/Validation Rules/Global Rules You'll want to remove the rule from the Validate Button, and Validate Button fields of the item. Update There are field specific rule items that you can update to remove the Is XHtml if needed. The Rich Text field is located at /sitecore/...


5

Pointing to the entire bootstrap.css is a bit overkill. (And I suspect Sitecore / Telerik is having a hard time parsing it.) What you should do is ignore the ToolsFile.xml entirely (make sure the <classes> element is empty), and point the WebStylesheet setting to a custom CSS file that only includes classes that should be exposed for selection. Since ...


5

To resolve the issue, please update the Telerik RTE assemblies to the newer version: Extract the Telerik.Web.UI.dll and Telerik.Web.UI.Skins.dll assemblies from the attached archives into your \bin folder (replacing the existing ones). Replace the Telerik.Web.UI.XML file in your \bin folder with the attached one. Add the Telerik.Web.UI assembly binding to ...


5

You could tie into the saveRichTextContent Pipeline. You could then parse the html that has been entered, and find all the images and strip out the width and height, which is a good practice if you have a responsive site. Patch: <configuration> <sitecore> <pipelines> <saveRichTextContent> <...


5

The short answer is - you can't. By design, even if you disable the Edit HTML tab in the RTE, just by editing the text, the editor will modify the html contained within. Your component is designed wrong for this use case. If you want full control over the markup, then you should use a rendering that holds the markup in a razor view and then renders fields ...


5

You can add a new CSS class in the Rich Text Editor dropdown and apply it to the selected row table. There are two steps to add CSS class in RTE: Add element inWebsite\sitecore\shell\Controls\Rich Text Editor\ToolsFile.xml file. Now add the definition of that CSS class (eg. arrowlink) in Website\default.css file. You can see newly added arrowlink CSS ...


4

HtmlAgilityPack.dll is used. public class Renderer { public string DoRender(HtmlDocument document, int length) { int totalLength = 0; int i = 0; foreach (var htmlNode in document.DocumentNode.Descendants()) { i++; if (htmlNode.NodeType != HtmlNodeType.Text) { ...


4

This is a known issue in SXA 1.5, it was fixed in SXA 1.6 so if you can I highly recommend you to upgrade. Rendering Variants do not work on Overlay items thus you cannot see renderings because they have no default rendering variant selected. You can still assign RV in Raw Values but I think this is not a solution Quick fix: Custom service Add missing ...


4

You should leave it as is. target="_blank" is a security vulnerability. In previous versions, you had to fix this yourself but in Sitecore 8.2 onwards, this is the default behaviour. More information here: Adding rel=”noopener” to Sitecore Edited to add: Your clarified behaviour, however, is clearly a bug and should be taken to Sitecore Support.


4

There is a setting in config which allows you to set which tag to use for line breaks. By default it is set to use the p tag but you can change it to something else, using a patch config file: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/"> <sitecore> <settings> ...


4

This blog post describes the detailed steps to configure a custom dropdown list button in the Rich Text Editor in Sitecore 9: https://sitecorerunner.com/2018/08/21/adding-rte-richtext-custom-dropdown-list-in-sitecore-9/ One thing that is not explicitly called out in the article is that you need to use the Html Editor Custom Drop Down Button template when ...


3

The solution from @Sitecore Climber is robust, but if you are looking for a quick-and-dirty solution, you can analyze your role capabilities and look for subsets of capabilities. If all your users are subsets of each other, you define a new HTML Editor Profile in the Core database and then update the HtmlEditor.DefaultProfile setting to use your custom ...


3

The Sitecore way to replace the text in a Rich Text field would be to create a custom processor in <renderField> pipeline, insert it before RenderWebEditing to ensure all links in fields are expanded. You would then need to wrap the text of the all <a> elements which links to a pdf with the additonal markup you require, probably best done using ...


3

FormatBlock For your question, you can find the values for the FormatBlock under the item /sitecore/system/Settings/Html Editor Profiles/Rich Text Full/Paragraphs. Out of the box, Sitecore's formatting is pretty boring. But you can add some styling to the selections to make them look better. Similar to the class drop down. See this link to find out more ...


3

There is a option "add custom color" but it dissappear after closing the editor window. But you can add custom color statically. Open Website\sitecore\shell\Controls\Rich Text Editor\ToolsFile.xml Find <colors> configuration. Define required colors there. Something like: <colors> <color value="#FF00EE" /> <color value="#...


3

This is a known bug.I raised a ticket to Sitecore support and they replied that it is a bug and it already resolved in Sitecore 8.2 update 6 So you have two choices here - Upgrade your solution on Sitecore 8.2 update 6 or Raised a support ticket on Sitecore support portal and they will provide you the fix/patch.


3

What you can do is you can just use the true or false for those attributes you require to implement. Simply just doing autoplay="true" loop="true" controls="true" Because autoplay="true" and autoplay is all same. Check this. It works like a charm. For reference check this: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video


3

We encountered the same issue and fixed it in the ToolsFile.xml. Our experience is that the classes section of that file should be empty to have the classes from your attached css file to be imported in the dropdown of the RT editor. This way there should be no need to add all your classes in the xml file and you can just use the external css file. ...


3

Whatever you're doing, I think you're off doing something pretty far removed from established Sitecore Best Practices. That said: string richText = yourItem["rich text field"]; string expandedLink = LinkManager.ExpandDynamicLinks(richText); Will do what you ask. If you want to override Sitecore's own behaviour, you need to find the <renderField> ...


3

Just set a display name of your button to whatever you want to be a tooltip:


3

You can use item:saving event. Be aware that in some cases saving of the item can be intercepted so not necessarily your changes will be saved. <sitecore> <events> <event name="item:saving"> <handler type="My.Assembly.Namespace.RemoveEmptyParagraphsFromRichTextProcessor, My.Assembly" method="OnItemSaving" /> &...


3

It should be available for you by default: Click Show editor on field that your want to edit Select tassel icon Select Strip Css Formatting from dropdown menu If it is not available in your version/configuration, then you can enable it by selecting HTML Editor Profile. Open template field on which you want to be able to remove style attributes Set source ...


Only top voted, non community-wiki answers of a minimum length are eligible