Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/UWKM/uwkm_streamfields
A basic set of Wagtail Streamfields for fun and profit
https://github.com/UWKM/uwkm_streamfields
Last synced: 3 months ago
JSON representation
A basic set of Wagtail Streamfields for fun and profit
- Host: GitHub
- URL: https://github.com/UWKM/uwkm_streamfields
- Owner: UWKM
- License: bsd-3-clause
- Created: 2017-03-27T10:19:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T13:13:00.000Z (about 7 years ago)
- Last Synced: 2024-04-26T21:04:15.036Z (9 months ago)
- Language: CSS
- Size: 988 KB
- Stars: 32
- Watchers: 5
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-wagtail - UWKM Streamfields
README
UWKM WAGTAIL STREAMFIELDS
=========================This is a set of pre-defined streamfields for Wagtail. It provides:
- accordions
- background image with text overlay
- buttons
- call to action buttons
- colored block
- divider
- image gallery
- bootstrap grid
- header
- icon blocks
- image blocks
- quotation lists
- raw html block
- slider
- slogans
- tabs
- tables
- text fields
- youtube video blocksThis packages comes with a set of html templates, which you might want to tweak
or modify.Installing uwkm_streamfields
============================1. Install the package using pip: `pip install uwkm_streamfields`.
2. Add `wagtail.contrib.table_block` to `INSTALLED_APPS` in your project settings.
3. Add `uwkm_streamfields` to `INSTALLED_APPS` in your project settings.
4. Add `from uwkm_streamfields.settings.base import *` to your project settings.
5. Add import `from uwkm_streamfields.blocks import GridBlock` to your project models.
6. Use the `GridBlock` as such:models.py
::
class SomePage(Page):
some_content = StreamField(
[('fixed_width', blocks.ListBlock(
GridBlock(),
template = 'streamfields/fixed_grid.html',
icon='fa-th-large',
label='Boxed'))
,('full_width', blocks.ListBlock(
GridBlock(),
template = 'streamfields/full_grid.html',
icon='fa-th',
label='Full'))
],
null = True,
blank = True
)content_panels = Page.content_panels + [
StreamFieldPanel('some_content'),
]7. Use `some_content` as such:
somepage.html
::
{% for block in page.some_content %}
{{ block }}
{% endfor %}8. Change the settings as you like:
settings.py
::
BS_SIZE = 'sm'
STREAMFIELDS = '__all__'
EXCLUDE_STREAMFIELDS = []9. Make sure you atleast have the following javascripts/stylesheets in your base.html
base.html
::
{# Global stylesheets #}
{# Global javascript #}
10. Extra:
add to templates/wagtailadmin/admin_base.html (if overridden)
::
{% block css %}
...
{% endblock %}{% block js %}
...
var collapse = '{{ settings.uwkm_streamfields.streamfieldssettings.collapse_streamfields }}' == 'True';
...
{% endblock %}UWKM, 2017