Hot answers tagged

12

Add the linkNewTab config option to the Redactor config you're using: So, that would become something like: { "buttons": [...], "plugins": [...], "linkNewTab": true }


11

With RC1 the rich text editor was moved to a plugin. You can find the Redactor editor (the previous richtext field) in the plugin store along with a new CKEditor editor as well. You can read about this in the docs, too: https://docs.craftcms.com/v3/changes-in-craft-3.html#rich-text-fields


8

It turns out that the latest redactor seems to now have a plugin for viewing the source. You can enable this in your redactor JSON config file under plugins. Just add the "source" plugin like so: { "buttons": ["format", "bold", "italic", "lists", "image"], "plugins":["fullscreen", "source"], "toolbarFixed": true }


6

You need to add "html" in the buttons array, and not "source" in the plugins array.


5

not sure if it matters but in my config I have buttons in quotes "buttons": ["format","bold","italic","underline","lists","link","file","image","horizontalrule"],


5

Quoting Brad Bell in a recent thread: If you're on Craft 2.6.2950 or greater, it includes Redactor II 1.3.1, where they re-introduced image resizing and positioning support. You'll just need to add: imageResizable: true, imagePosition: true to whatever craft/config/redactor config file your Rich Text field is set to use under its settings. ...


4

As of Craft 2.5.2759 this is now possible. It is now possible to include custom URL fragments in links to entries within Rich Text fields, alongside the entry's reference fragment (e.g. href="my-entry#custom-fragment#entry:123").


4

You can use this superb plugin: RetconHTML Ever have a client put 4 MB PNG files in their Redactor fields, failing to apply any of your meticulously crafted image transforms? Writers consistently using the tag for headers? Have you ever needed to implement lazy loading of images embedded in WYSIWYG content, responsive images or wanted to remove pesky ...


4

You can use the Redactor Inline Styles add-on then use the following in your Redactor json config: "plugins": ["source","fullscreen","inlinestyles"], "buttonsAddAfter": "italic", "buttonsAdd": { "cite": { "title": "Cite", "args": ["cite"] } } You'll then be able to add a cite element within a blockquote ...


3

Asking us to predict the future is hard (and probably a little off-topic). But I'll go ahead and contribute what little knowledge I have... Per conversations in Craft Slack, a few reputable plugin developers have casually mentioned that they may or may not be working on plugins for the following WYSIWYG editors... Froala CKeditor Tiny MCE Because Slack ...


3

Eventually, if a Craft CKEditor plugin doesn't come to life, then we might consider developing a 1st party (Pixel & Tonic) CKEditor plugin, although it would likely not replace the native Redactor Rich Tech Field implementation. And of course, 3rd party plugins can implement whatever WYSIWYG they want to use.


3

Go into the Plugins Sections. and install the plugin with the name Redactor And everything will be back to normal.


3

It works for me, just changing the config file: { "buttons": ["html", "bold", "italic"], "plugins": ["fullscreen", "**limiter**", "counter"], "linkNewTab": true, "toolbarFixed": true, **"limiter": 235** }


2

Imperavi, creators of Redactor provide the Limiter plugin to add this functionality but you would need to create a Craft plugin to add the JS, as detailed in this answer.


2

Redactor applies all kinds of 'improvements' to your HTML on save. You might be able to prevent this behaviour by altering the config. If you want to use a plain text field for html, your only problem is that Twig applies html_encode to outputted text. You can prevent this by using the |raw filter: {{ entry.plainTextField |raw }}


2

I don't think so. You can see the entire code here ClassicEditor .create(document.getElementById('{$nsId}')) .then(function(editor) { $(editor.element).closest('form').on('submit', function() { editor.updateEditorElement(); }); }) This is the javascript that triggers the editor, as you can see, there are no config settings ...


2

Thanks guys - yes I'm fully aware of the downfall of letting clients run free with the editor, and we've had discussions internally about tables & trying to stop the client from using them but in this particular case there's a real need for an editor which is more fully featured. I am however looking for a solution, and CKEditor seems like the best. I'...


2

Am I heading down the wrong path? If you gotta ask that question, sometimes it's a self-fullilling prophecy! ;) One of the big reasons people use Craft is it does a great job of separating content from layout, which is becoming important when trying to build for all types of screens as Damon also alluded to in his answer. Tables are tough. I try to avoid ...


2

From my experience, I try to strip out as much formatting options as I can from any wysiwyg editor. Otherwise you'll end up with large, purple text with a red background (or some other crazy style the client thinks looks good). I understand the client wants to construct a table - then alter the table along with the graphics etc. What if... Create a ...


2

This is a feature of "redactor" which is used with Craft to clean and format input. To change the settings, you need to change the config in Craft/config/redactor/. See http://buildwithcraft.com/docs/rich-text-fields and http://imperavi.com/redactor/docs/settings/clean/#setting-allowedTags This is not, however, working for me with iframes, which is a ...


2

I just figured out how to do this. It was vexing me! Anyway, Craft is awesome and has provided support for Reference Tags. Write your Markdown like this: [link text]({entry:20}) Here's the Twig: {{ entry.markdown|parseRefs|markdown }} Reference Tags support more than just entries, but this was the bit that I needed.


2

There is a purify and a Clean-up option on a WYSIWYG field. Clean up HTML? – Whether Craft should run through some HTML cleanup routines when the field is saved, including removing all tags, empty tags, and most style attributes. Purify HTML? – Whether the field should run submitted data through HTML Purifier before getting saved to the database, removing ...


1

Craft uses Redactor as its rich text editor - Redactor has numerous configuration options, one of which is direct html editing. One option would be to create a new Redactor configuration that includes the 'html' button. For example, You could copy Craft's "Standard" Config: { "buttons": ["format","bold","italic","lists","link","file","horizontalrule"], "...


1

You have to add this setting: imageUpload: true Example: $('.editor').redactor({ s3: 's3upload.php', fileUpload: true, imageUpload: true, buttons: ['format', 'bold', 'italic', 'underline', 'deleted', 'lists', 'outdent', 'indent', 'image', 'file', 'link', 'alignment', 'horizontalrule', ...


1

This is more of a workaround than a truly official method. The #entry:id you are seeing is more of a reference for Craft to figure out the correct URL when you edit the entry later. If you were to look at the link live, you would notice that the hash is missing. The workaround is to create a link to an entry. Then, either save and return or toggle Edit ...


1

I'm not sure what's going on with the story.html part, but you'll need to double escape your regex. Assuming you have an entry already with a story Rich Text field, it'd look like this: {{ entry.body|raw|replace("/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU", "\1\2\3") }}


1

This is not possible at the moment. Craft 2.5 uses the updated Redactor II WYSIWYG editor, which dropped this from it's features. All pasted text is stripped to plain text. Perhaps someone can suggest an alternative method that we can set up to make this easy for content editors.


1

From my personal experience, this is the type of thing that occurs when PHP/HTML set-up has a bug. You could be having an issue using the Rich Text input for entering HTML for that reason. Perhaps you could try making the edit in your website templates/css directly. You can find tutorials to help you on http://buildwithcraft.com/docs/introduction


1

You have to add the JS with a Craft plugin, either a custom one making use of includeJsResource (see this answer for code example) or with the Control Panel JS plugin.


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