Wagtail richtext addon that opens links in a new tab or window
MIT License
A simple app that gives you the option to add links to the richtext editor in Wagtail that always open in a new tab.
Table of Contents
$ pip install wagtail-external-link-richtext
Add wagtail_external_link
to your INSTALLED_APPS
:
INSTALLED_APPS = [
# ...
'wagtail_external_link',
# ...
]
Add "new_tab_link"
to your RICHTEXT_FEATURES
in your settings:
RICHTEXT_FEATURES = [
# ...
'new_tab_link',
'link', #IMPORTANT IT MUST ALWAYS BE ABOVE `link`
]
When you add a RichTextField
to your model, you will now see a new button called New tab 🔗
in the richtext editor:
New tab 🔗
button.Submit
.Correct way to render the link in your template:
{% load wagtailcore_tags %}
{{ page.body|richtext }}
wagtail-external-richtext-link
is distributed under the terms of the MIT license.