Add emoji to StreamField.
Project description
Wagtail Emoji :tada:
====================
:clap: Add [NotoEmoji](https://github.com/googlei18n/noto-emoji) icons to StreamField. :bomb: :gun: :smoking: :knife:
![Screenshot](screenshot.png)
:warning: **IMPORTANT: JUST BECAUSE YOU CAN DOESN'T MEAN YOU SHOULD.**
Install
-------
pip install wagtailemoji
Then add `wagtailemoji` to your installed apps.
Usage
-----
### StreamField
Add emoji to StreamField [the regular way](http://docs.wagtail.io/en/latest/topics/streamfield.html#basic-block-types), just set `icon="emoji-something"`. Reference [the full list](https://github.com/alexgleason/wagtailemoji/blob/master/wagtailemoji/static_src/wagtailemoji/scss/wagtailemoji.scss).
### wagtailmodeladmin
[wagtailmodeladmin](https://github.com/rkhleics/wagtailmodeladmin) is supported if you're using Wagtail 1.4 or above. Similar to StreamField, just set `icon="emoji-something"` on your menu item.
### Hallo plugins
You can use emoji on custom Hallo buttons by setting the `icon` option to `icon icon-emoji-something`.
```javascript
button.hallobutton({
label: "Skull",
icon: 'icon icon-emoji-skull',
});
```
### Other parts of the admin
You can include icons anywhere in the admin with:
```html
<i class="icon icon-emoji-something"></i>
```
In Wagtail 1.3.x and below you can only use icons on the page editor screen.
### On the front-end
You can also import this on the front-end, if you want.
```html
{% load staticfiles %}
<link rel="stylesheet" href="{% static 'wagtailemoji/css/wagtailemoji.css' %}">
```
Then include icons anywhere on the front-end with:
```html
<i class="icon icon-emoji-something"></i>
```
### Using wagtailemoji as an optional dependency
If you want to distribute a Wagtail plugin with emoji, you can use this package as an optional dependency by checking if it's installed in Django, and falling back otherwise.
```python
from django.conf import settings
from wagtail.wagtailcore.blocks import StructBlock
class BlockquoteBlock(StructBlock):
quote = TextBlock()
author = TextBlock()
class Meta:
if 'wagtailemoji' in settings.INSTALLED_APPS:
icon = 'emoji-skull'
```
(in this case, the fallback is to do nothing)
====================
:clap: Add [NotoEmoji](https://github.com/googlei18n/noto-emoji) icons to StreamField. :bomb: :gun: :smoking: :knife:
![Screenshot](screenshot.png)
:warning: **IMPORTANT: JUST BECAUSE YOU CAN DOESN'T MEAN YOU SHOULD.**
Install
-------
pip install wagtailemoji
Then add `wagtailemoji` to your installed apps.
Usage
-----
### StreamField
Add emoji to StreamField [the regular way](http://docs.wagtail.io/en/latest/topics/streamfield.html#basic-block-types), just set `icon="emoji-something"`. Reference [the full list](https://github.com/alexgleason/wagtailemoji/blob/master/wagtailemoji/static_src/wagtailemoji/scss/wagtailemoji.scss).
### wagtailmodeladmin
[wagtailmodeladmin](https://github.com/rkhleics/wagtailmodeladmin) is supported if you're using Wagtail 1.4 or above. Similar to StreamField, just set `icon="emoji-something"` on your menu item.
### Hallo plugins
You can use emoji on custom Hallo buttons by setting the `icon` option to `icon icon-emoji-something`.
```javascript
button.hallobutton({
label: "Skull",
icon: 'icon icon-emoji-skull',
});
```
### Other parts of the admin
You can include icons anywhere in the admin with:
```html
<i class="icon icon-emoji-something"></i>
```
In Wagtail 1.3.x and below you can only use icons on the page editor screen.
### On the front-end
You can also import this on the front-end, if you want.
```html
{% load staticfiles %}
<link rel="stylesheet" href="{% static 'wagtailemoji/css/wagtailemoji.css' %}">
```
Then include icons anywhere on the front-end with:
```html
<i class="icon icon-emoji-something"></i>
```
### Using wagtailemoji as an optional dependency
If you want to distribute a Wagtail plugin with emoji, you can use this package as an optional dependency by checking if it's installed in Django, and falling back otherwise.
```python
from django.conf import settings
from wagtail.wagtailcore.blocks import StructBlock
class BlockquoteBlock(StructBlock):
quote = TextBlock()
author = TextBlock()
class Meta:
if 'wagtailemoji' in settings.INSTALLED_APPS:
icon = 'emoji-skull'
```
(in this case, the fallback is to do nothing)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wagtailemoji-1.0.2.tar.gz
(305.1 kB
view details)
Built Distributions
wagtailemoji-1.0.2-py3.5.egg
(305.5 kB
view details)
File details
Details for the file wagtailemoji-1.0.2.tar.gz
.
File metadata
- Download URL: wagtailemoji-1.0.2.tar.gz
- Upload date:
- Size: 305.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c33bbd6fec47392ea5b65d7c91a23caa6aebcfc0d003b4a78dd47ed1ec82c0f |
|
MD5 | 8fc6206c911c9b82701d9e0d09518da3 |
|
BLAKE2b-256 | 67254fe63529205b1f74aca4a6be3d81f3ab35438bbd3dab6e15aad3338d0e1e |
File details
Details for the file wagtailemoji-1.0.2-py3.5.egg
.
File metadata
- Download URL: wagtailemoji-1.0.2-py3.5.egg
- Upload date:
- Size: 305.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a739f915e6a093a3c16515db9115d85e1c913a48e978df54adfdfb30b8c800e8 |
|
MD5 | ff20913ff5612cd1789570bd109fc83d |
|
BLAKE2b-256 | 2a9e1deb5ec21bd2d6ce1defd843be3699aff98ab4713bd8a59dfed19812229c |
File details
Details for the file wagtailemoji-1.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: wagtailemoji-1.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 306.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77d7ba0e4f650f03f08442752e92a24b1581677b9e5f3cc33b21387613eb3037 |
|
MD5 | 29947d46ab29757ff06c0cde7136fd45 |
|
BLAKE2b-256 | 9d6ceb97244ced56658becea740d74e1b81d13c8479f3e9a57db8acfd3e8e447 |