Skip to main content

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.

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 hashes)

Uploaded Source

Built Distribution

wagtailembedder-0.1.3-py2.py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page