This is a Drupal module to allow images embedded in CKEditor via the Entity Embed module to link to any URL. It
leverages the functionality from Lightning Media/Lighting Media Image 3.x to use Field Formatters to specify display
options. The field formatter provided presents additional options to specify whether the image will link to a specified
URL, what that URL is, and target="_blank"
and rel="nofollow"
toggles.
To use:
- Configure embed button at
/admin/config/content/embed
- Click
Edit
link to the relevant embed button - Check
Embed image link image
underAllowed Entity Embed Display plugins
and save. - Configure text format at
/admin/config/content/formats
- Click
Configure
operation for relevant text format - Make sure the embed button is in the
Active Toolbar
for the text format - Make sure that
Display embedded entities
is checked underEnabled filters
- Make sure that
<drupal-entity data-* title alt>
is included in theAllowed HTML tags
- Save the text format configuration
- Edit or create any entity with a formatted text field.
- Find the embed button appears when the text format is selected in the editor.
- Press the embed button and select an image.
- In
Link image to
dropdown field in theEmbed media item
dialog, selectSpecify a URL
- Enter a URL in the
Specify a URL to link to
field when it appears. - Optionally check the
Add rel="nofollow" to links
orOpen link in new window
buttons - Press
Embed
- Save the entity, and observe that on view the image will link to the specified address.