Snippets embedder for Wagtail RichTextField.
Project description
wagtailembedder
==================
![Wagtailembedder scnreenshot](http://i.imgur.com/qDPKz7r.png)
Snippets embedder for Wagtail RichTextField.
# Quickstart
``` $ pip install wagtailembedder```
add wagtailembedder to your settings.py in the INSTALLED_APPS section:
```
...
'modelcluster',
'wagtailembedder',
'core',
...
```
For each of your models registered as a wagtail.wagtailsnippets create an html file to render the template inside a RichText field.
Example: if we have a ```SocialMediaLink``` snippet in our ```core``` app we need to create a template in ```core/templates/snippets/social_media_link.html```. The variable containing the snippet instance in the template is ```snippet```.
If no template is defined then an exception will be raised in the frontend when rendering a RichTextField with the embedded snippet in it. Make sure you write some templates for your snippets before start to embedding them.
Templates names will match snippets models names replacing capital letters with underscores, Wagtail style.
==================
![Wagtailembedder scnreenshot](http://i.imgur.com/qDPKz7r.png)
Snippets embedder for Wagtail RichTextField.
# Quickstart
``` $ pip install wagtailembedder```
add wagtailembedder to your settings.py in the INSTALLED_APPS section:
```
...
'modelcluster',
'wagtailembedder',
'core',
...
```
For each of your models registered as a wagtail.wagtailsnippets create an html file to render the template inside a RichText field.
Example: if we have a ```SocialMediaLink``` snippet in our ```core``` app we need to create a template in ```core/templates/snippets/social_media_link.html```. The variable containing the snippet instance in the template is ```snippet```.
If no template is defined then an exception will be raised in the frontend when rendering a RichTextField with the embedded snippet in it. Make sure you write some templates for your snippets before start to embedding them.
Templates names will match snippets models names replacing capital letters with underscores, Wagtail style.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wagtailembedder-0.1.5.tar.gz
(7.1 kB
view hashes)
Built Distribution
Close
Hashes for wagtailembedder-0.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c83d93e519d5a07cbd78f03ce2db6abad31ba2f157444c74d1d4cb84adada29a |
|
MD5 | 64adf82a9f46e3f0b036fca6260b4cf3 |
|
BLAKE2b-256 | d99f6003288e7acc780f6551073fe01e22dc55d9d469b2ac7fb30ba6490c255f |