People who code: we want your input. Take the Survey

Hot answers tagged

17

Getting a Matrix field working on the front-end is going to require 2 things: Setting up the field inputs so the data submits correctly. Some custom JavaScript to make the blocks repeat and behave how you want them to. Here's an example of the Matrix input code you'll need on the front-end. You'll need to update all of the field handle values to fit your ...


13

If by styles you mean the formatting drop-down, just add them in an array: { buttons: ['bold', 'italic'], formatting: ['p', 'blockquote', 'h2', 'h3', 'h4', 'SomeHtmlTag'] } . If you want to have a button which adds custom CSS-classes, take a look at: Redactor CSS by Nathan Doyle Update (July 2015) Craft 2.3.2615 (Dec 2, 2014) and above use ...


13

For the Live Preview button to show up, two criteria must be met: Your section’s “Entries in this section have their own URLs” setting must be checked Your section’s “Entry Template” setting must be set to a valid template path For Craft 3.2+ pro version, a preview target must be specified. This happens automatically, but might be missing due to a bug. Add ...


9

It's worth noting that as of Craft 2.5, it's now using Redactor II, so the above code examples don't work if you have upgraded. Here's a working JSON config example you can build on: { "buttons": ["format","bold","lists","link","file","image"], "plugins":["source","fullscreen"], "toolbarFixed": true, "formatting": ["p", "blockquote", "h2", "...


8

Victor answers my questions regarding the formatting tags and the fact that you need to create a Craft plugin to add Redactor plugins. Since there wasn't a solution for adding classes on inline elements with custom classes/styles, Nathan's plugin only supports block elements, I created a plugin that wraps the Styles Redactor plugin. You can get it here: ...


7

One solution that comes to mind is to add your own custom status field (i.e. 'reviewStatus') as a drop-down menu (or checkbox perhaps if only one status). Then add this field as a column in your list view via a small plugin, using the new modifyEntryTableAttributes hook. public function modifyEntryTableAttributes(&$attributes, $source) { if ($source ...


5

Not sure if it helps, but I accomplished this using a plain text field (with multi-line enabled). Then I just used CSS to format the field in a way to make it look like a code snippet... Screenshot of field in the Control Panel: I used the Control Panel CSS plugin to add this CSS: #fields-myfieldhandle textarea.nicetext { font-size: 13px; font-...


4

I copied your Redactor settings to a clean installation of Craft (2.6.2945) and added an image to a Rich Text field set to use those specific settings. Initially I encountered the same behaviour. However, unlike in your experience, after disabling the Purify HTML? option on the Rich Text field, the figcaption element persisted after saves.


4

Douglas has posted a great suggestion about creating an additional custom field for "Status". But I think it's also worth mentioning Josh Crawford's great free plugin called Workflow which takes Craft's built-in permissions a step further with: User interface improvements, including a button to "Submit for Review" Email notifications to notify publishers ...


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

This plugin does it for Craft 3: https://github.com/kffein/craft-bulk-edit


3

Have you specified a template to use under that section's settings? If you didn't, the Live Preview button won't show.


3

If you are looking for "drag and drop" I would use matrix blocks. You can define text block, image block, video block, etc that would be available in Elementor. Maybe you don't get as much out of the box as a plugin, but you are able to define exactly what is available to the client. Happy coding :)


3

The typical 'Craft' way of doing this would be via a Matrix field instead of a single text block field, so that editors can sandwich the dynamic content (which would be its own block type) in between whatever other block types they select. That way is very powerful, flexible, extensible, and clean... However, assuming migrating your content to a Matrix ...


3

Have you considered using the Matrix field type? You could create a block for rich text, then a block for a contact form (or whatever widget). You could probably achieve what you're asking with a plugin but in my experience doing things like this in Redacter are prone to weirdness/bugginess (especially when in the hands of a client).


2

I just had the same issue of the Live Preview button not displaying. I followed the instructions from Brandon and Brad and still did not see the live preview button. It was not till that I created the template in the template directory that the live preview button appeared. I am using Craft Pro 2.5.2759, installed on my local machine with MAMP. I hope ...


2

Nope, not currently... though there is a feature request for it: http://feedback.craftcms.com/forums/285221-feature-requests/suggestions/9009169-add-an-alert-or-warning-when-multiple-authors-are I guess it's possible for it to be done in a plugin, although I'm struggling to picture exactly how. At this time, no such plugin exists.


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

If you're looking for professional-grade videos showing off what Craft can do, then Jamie has already pointed you in the right direction... If you'd like to add your own content to help your clients find their way through the construction of your particular project, check out the awesome Craft Help plugin, which allows you to document the details of how ...


2

The Features section on the Craft site already has some useful videos that may be of interest: https://buildwithcraft.com/features/matrix


2

Okay, so I figured this out and its a very stupid twig template noob mistake on my part. The mistake is this: I had a section called 'demo' with a field called 'demoField' and created a template folder called 'demo' with an index.html file inside. The mistake is that my template had this: {% for entry in craft.entries.section('demo').find() %} {{ ...


2

Something like the following should work. This assumes that your category field handle is 'jobCategory', and has a limit set to 1. {% set categories = craft.categories.group('jobCategory') %} {% set entryCategory = entry.jobCategory.first %} <label for="fields[jobCategory]">Job Category:</label> <select id="jobCategory" name="fields[...


2

This has been requested in the Craft feedback forum (vote for it if you like, here and here). But as of Jan 2017, there is no functionality for this in a default Craft install. The closest thing I've come across is the NP Edit Multiple Elements plugin which allows you to edit multiple entries sequentially meaning that when you hit save it automatically ...


2

I'm not 100% sure I follow, but I think this is what you are looking for. In your javascript file, you'll want code.set API Reference ... $('#yourTextArea').redactor('code.set', your.data);


2

Yes, you will have to define the elements that the client will manage for a page. If you watch the video in craftcms.com landing page you can see how that would look like. The elements on the left are the fields that you would define (from a field type) and then you would add them to a Craft section. For the rich text you have Redactor field type, which ...


2

Just make a channel for your generic pages, and set the route to {slug}, that way your editors can create, delete, edit and disable any generic template pages without needing to touch the more involved areas of the Control Panel


2

This will be possible using a new imageEditorRatios config setting that is coming in Craft 3.5 (due to release in early August 2020): ... 'imageEditorRatios' => [ 'Unconstrained' => 'none', 'Original' => 'original', 'Square' => 1, '16:9' => 1.78, '10:8' => 1.25, '7:5' => 1.4, '4:3' => 1.33, '5:3' => ...


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