Wagtail Column Blocks
Project description
A generic, reusable column block for Wagtail streamfields.
Allows developers to create column layouts with a number of different layout
ratios that are supported in the admin in a visually appealing way.
![Admin interface showing column blocks in a streamfield](/docs/admin.png?raw=true)
A basic frontend template is included, but no frontend CSS. Due to the
variations of responsive layouts and frontend layout frameworks,
frontend templates should be overridden by the developer.
Usage Example
-------------
```python
class CommonBlocks(blocks.StreamBlock):
content = RichTextBlock(group="Common")
image = ImageChooserBlock(group="Common")
embed = EmbedBlock(group="Common")
class ColumnBlocks(blocks.StreamBlock):
column_1_1 = ColumnsBlock(
CommonBlocks(),
ratios=(1, 1),
label="Two halves",
group="Columns",
)
column_2_1 = ColumnsBlock(
CommonBlocks(),
ratios=(2, 1),
label="Two thirds/One third",
group="Columns",
)
column_1_1_1 = ColumnsBlock(
CommonBlocks(),
ratios=(1, 1, 1),
label="Three thirds",
group="Columns",
)
class AllBlocks(ColumnBlocks, CommonBlocks):
pass
```
License
-------
Licensed under the BSD 3-clause "New" or "Revised" License.
(c) 2017, Squareweave. All rights reserved.
Allows developers to create column layouts with a number of different layout
ratios that are supported in the admin in a visually appealing way.
![Admin interface showing column blocks in a streamfield](/docs/admin.png?raw=true)
A basic frontend template is included, but no frontend CSS. Due to the
variations of responsive layouts and frontend layout frameworks,
frontend templates should be overridden by the developer.
Usage Example
-------------
```python
class CommonBlocks(blocks.StreamBlock):
content = RichTextBlock(group="Common")
image = ImageChooserBlock(group="Common")
embed = EmbedBlock(group="Common")
class ColumnBlocks(blocks.StreamBlock):
column_1_1 = ColumnsBlock(
CommonBlocks(),
ratios=(1, 1),
label="Two halves",
group="Columns",
)
column_2_1 = ColumnsBlock(
CommonBlocks(),
ratios=(2, 1),
label="Two thirds/One third",
group="Columns",
)
column_1_1_1 = ColumnsBlock(
CommonBlocks(),
ratios=(1, 1, 1),
label="Three thirds",
group="Columns",
)
class AllBlocks(ColumnBlocks, CommonBlocks):
pass
```
License
-------
Licensed under the BSD 3-clause "New" or "Revised" License.
(c) 2017, Squareweave. All rights reserved.
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
wagtailcolumnblocks-2.0.0.tar.gz
(430.7 kB
view hashes)
Close
Hashes for wagtailcolumnblocks-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8b8caf05c4c3688b1f6ab3b937961929af817eb26e670a2b7ed231ec009d3e3 |
|
MD5 | 08b08eb21f5e41b509fb11ebdc5171a2 |
|
BLAKE2b-256 | 601378a160e3b63c4d70ff3054f1fdb019fea5b1f07431d71ffa9148608a1bee |