dynamic value inside richtext editor - umbraco7

I am tring to use some data from my content to be shown in richtext editor.
but It shows as a text;
var contactDetails = #Umbraco.TypedContentAtRoot().ElementAt(2);
#contactDetails["Phone"]

You'll have to use a macro for that and allow to use them in the rich text editor.
https://our.umbraco.org/documentation/reference/templating/macros/

Related

How to disable pasting inline styles on CKEditor?

How do I disable contents for styles when pasting to CKEditor?
Overview, I'm trying to fix width styles on my DOMPdf, but inline styles pasted to CKEditor is messing up with the styles I've set up in DOMPdf.
I've applied what was posted here https://docs.ckeditor.com/#!/guide/dev_disallowed_content.
And so far, here's some of what I tried
CKEDITOR.config.disallowedContent = "table(width)",
CKEDITOR.config.disallowedContent = "table[style]"
But when I copy and paste from word docs or customized html strings, styles or width would still be pasted. Any tips? Thanks!
First of all if you want to remove the width style from the table, you need to use:
CKEDITOR.config.disallowedContent = 'table{width}';.
The rule CKEDITOR.config.disallowedContent = "table(width)" will remove the width class from the table and CKEDITOR.config.disallowedContent = "table[style]" will not do anything because styles are defined in {} and not in [].
Read more about the format of Allowed Content Rules here: https://docs.ckeditor.com/#!/guide/dev_allowed_content_rules
But when I copy and paste from word docs or customized html strings,
styles or width would still be pasted.
Please open the Full preset editor sample and try bolding the text or using some inline styles from the Styles dropdown. You will see tags like strong, code, big or span etc. are being used. In order to disallow them your ACF rule would need to look like so for example:
var editor = CKEDITOR.replace( 'editor1', {
disallowedContent : 'span;code;strong;big'
});
Please note that above rule disables span, strong, code and big tags completely in CKEditor. If you still wish to use these tags in the editor but filter content only during pasting, you should use paste events and regex to change the incoming HTML:
https://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-paste
https://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-afterPasteFromWord

quickreport exporttortf doc without textbox

I use psqrfilters to export a quickreport in .doc using exporttortf. It work´s fine, but all the text in doc is inside a textbox.
Is there a configuration to save it without a textbox ?
ExportToRTF(QuickRep1,'c:\test.doc') ;

Is htmlspecialchars needed for inline ckeditor?

I read the contents of a text file, use inline editor to edit then write back to same text file. Do I need to use htmlspecialchars? If I do, when? Displaying to html, writing back to the file or both?
When you output to the edit page ( the one with ckeditor ) you use both stripslashes() and htmlspecialchars().

Ajax HTML Editor - Get Markup

How can I get the HTML code (markup) that the AJAX HTMLEditor creates?
I'm trying to use the editor in order to transform rich text into a full html file. Then, the file will be used to write a SQL statement in order to insert it into a database.
You should be able to use the Content property.

How can i get Plain text from Ajax Editor?

I need to get both plain text as well as html text from Ajax Editor. I'm able to get the html text and not able to retrieve plain text. i'm not supposed to eliminate html tags from the editor to retrieve plain text.
Is there any property, which gives plain text from ajax editor?
Sample code from my app:
i'm able to get rich html text like this:
string desc = QuestionAndAnswerEditor.Content;
Same way i want plain text.
Please help me.
Use HTML.Encode for getting encoded text. and html.decode ..

Resources