Metadata-Version: 2.0
Name: wagtailembedder
Version: 1.0
Summary: Snippets embedder for Wagtail RichTextField.
Home-page: https://github.com/springload/wagtailembedder/
Author: Jordi J. Tablada
Author-email: jordi@springload.co.nz
License: BSD License
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content

wagtailembedder
==================

![Wagtailembedder scnreenshot](http://i.imgur.com/qDPKz7r.png)

Snippets embedder for Wagtail RichTextField.

# Quickstart

Install the package with ``` $ pip install wagtailembedder```

Add `wagtailembedder` to your `settings.py` in the `INSTALLED_APPS` section:

```python
INSTALLED_APPS = [
    ...
    'modelcluster',
    'wagtailembedder',
    'core',
    ...
]
```

For each models registered as a wagtail.wagtailsnippets create an html file to render the template inside a RichText field.

 * Templates names will match snippets models names replacing capital letters with underscores, Wagtail style.  
   For the ```SocialMediaLink``` snippet in the ```core``` app, it will look for the following template ```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.

# Options

If the snippet meta has a description field, it will show up next to the snippet name in the admin interface.

```python
from django.db import models
import django.db.models.options as options

options.DEFAULT_NAMES = options.DEFAULT_NAMES + ('description',)


@register_snippet
class MySnippet(models.Model):
    # fields definition

    class Meta:
        description = "My Snippet Description"
```


