Embeds plugin for Craft CMS 3.x
Allow using Embeds within Redactor. Embeds are referenced Matrix Blocks within the Redactor body.
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later and the Craft Redactor plugin.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
(As long as this is unreleased) Add the repository to your composer.json:
{ "repositories": [ { "type": "vcs", "url": "git@github.com:fork/craft-embeds.git" } ] }
-
Then tell Composer to load the plugin:
composer require fork/embeds
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Embeds. This will also install Redactor if it wasn't already installed before.
-
Enable the plugin in redactor by putting it into your config/redactor/MyConfig.json (see Embeds.json)
Embeds Overview
This plugin adds a Redactor plugin which enables editors to set markers between paragraphs in a redactor field. These markers then work as placeholders for blocks from a matrix field (embeds). In the current development phase, this plugin only supports one redactor field and one matrix field whit the names embedsCopy and embeds. The install migration of the plugin creates these fields automatically and also adds a Redactor configuration file for the copy field. Warning: Renaming the handles of these fields breaks the plugin! The matrix field will be empty. Redactor will be installed automatically by the install migration of this plugin.
Configuring Embeds
Currently there are no configuration options.
Using Embeds
Add the two fields to any of your EntryTypes' FieldLayout and don't forget to add some MatrixBlocks to the embeds field. When you add an embed marker to the copy text and add blocks to the matrix field, the plugin will show you which embed will appear at which placeholder.
Embeds Roadmap
Some things to do, and ideas for potential features:
- Fix the merging of copy and embeds
- Enable using multiple fields via plugin settings
- Evaluate possibilities for adding srcsets
![Fork Logo](https://raw.githubusercontent.com/fork/craft-embeds/master/./assets/heart.png)
Brought to you by Fork Unstable Media GmbH