Learn Wagtail Course

How to use Orderables in Wagtail CMS

In this video I go over how to add an Orderable to an existing Wagtail CMS Page. We'll use this feature instead of a StreamField to create an image gallery using a Bootstrap 4 Carousel.

The pros to using an Orderable instead of a ListBlock StreamField is that you can set a minimum and maximum number of items to add. In our example, we set a maximum of 5 images and a minimum of 1.

But the other hidden benefit is we can place our new Orderable content anywhere in the template and it's not confined to the loop where our StreamFields are rendered.

The Code

The Commit

If you'd like to see the entire commit, including the migration file and changes, it's accessible here on GitHub.

Was this helpful to you?

Sharing is caring. Help the community by sharing this article.