Skip to main content

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.

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

wagtailcolumnblocks-0.0.3.tar.gz (430.6 kB view details)

Uploaded Source

File details

Details for the file wagtailcolumnblocks-0.0.3.tar.gz.

File metadata

File hashes

Hashes for wagtailcolumnblocks-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7e4407731bd4da6a8b6560cf31e0ef84384a378a39bd868bfac99ae6f3eb4773
MD5 e89c1e30119803a2c7e903aaa5889cc8
BLAKE2b-256 c962628b3ac8529f832e0199768c44ca22c8e19176479de9703efd49796863ba

See more details on using hashes here.

Supported by

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