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.3.tar.gz
(6.6 kB
view details)
Built Distribution
File details
Details for the file wagtailembedder-0.1.3.tar.gz
.
File metadata
- Download URL: wagtailembedder-0.1.3.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ad4f7b9ab877cb5d5fead97edfb79367c4c4ec182d708b09f85a4a9d8b5f415 |
|
MD5 | edaf824aec675ea19880f93a8070c3a4 |
|
BLAKE2b-256 | c4eeb17d11cfdaada48496ce51c692fe55579328d834a6f0a236b96119d742be |
Provenance
File details
Details for the file wagtailembedder-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: wagtailembedder-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | edd7e5395043de222204bf74c0b43b13ef8cbeef922c27bef084b36f25857808 |
|
MD5 | 1c47f73c1d76249dd026a7520c088ba7 |
|
BLAKE2b-256 | 24e6d52180e0255e5c9b39d5ca30a212c49771d88d2bc084ad1c67c44735269e |