VIX-Chevron-Up

Organising Images and Documents Using Wagtail Collections

By Kieran Brown

This week we are going to go through a built in Wagtail feature that you may or may not know about… Wagtail collections.

Collections are a great way to organise assets into specific groups and what’s more is that permissions can be set be user group, enabling different departments to only see assets linked to their daily duties.

Transcript

Hello and welcome to this weeks installment of Wagtail Wednesdays. In today's video we are going to go through a simple yet useful feature in Wagtail which you may or may not know about. It's a feature called collections.

So first of all I'm going to start with what a collection is if you're new to Wagtail or if you've not come across it before. A collection is a built in feature which allows images and documents to be organised into groups. The good thing about these collections is that you don't have to be a developer to set them up and user permissions can either be set globally with the root collection or individually with specified groups. But I'll go into more detail with this shortly.

So let's start by looking at the default view for the images and documents area. We can see that we have a few images and a PDF document but there's no way to actually group them into a particular collection. To enable a collection we need to go to settings and then collections. I'm going to set up two different collection that mimics a real life application for two different departments within a company. The first, Human Resources and the second one will be Marketing.

So once we have done that we can then head over to the images area and we will now see a drop down selection box with all collections showing. If we select Marketing from the drop down it should show us all the images that are in that particular group. However, we haven't actually added anything to this collection yet. If we click all collections again and select one of the images we can now see that a collections panel is available on the actual image. So let's assign this image to the Marketing collection, save and then go back to the images. So now when we do the same thing as before the image is now organised in the Marketing collection. It's a really simple change yet it can help make finding a particular asset a lot quicker.

One last thing I'm going to go through is how admins can set group permissions for a given collection. We'll use the two collections we made earlier, Marketing and Human Resources as a good example of how it's most likely going to be used in a real life situation. If we go to settings and then groups we can see the default groups that are available to us, editors and moderators.

However, in our organisation we want to have separate groups for our HR Department and Marketing. We only want them to see the assets for their particular area. So let's create these groups. I'll name this first one Human Resources and we also want this group to access the Wagtail admin and we want them to be able to add and edit pages. If we then scroll down to the document and images permissions and then click 'add permission' we can assign this group to add and edit only the Human Resources collection we made earlier.

To finish, we just click add group and we can do the same for Marketing which I've already done to speed things up a bit. I've also created a new user called HR to demonstrate what we've done in action. So if I log out of the admin account and log into the HR account we can now see that we still have access to the images and documents however, we can only see the ones that we assigned to Human Resources collection earlier.

So there we have it, a great way to neatly organise images and documents and also separate collections based on different user groups. Thanks for watching this quick, simple video on collections.

If you enjoyed it, please consider liking and subscribing to our channel. You can also sign up to our mailing list for early access to our videos and you can find the link in the description below. Thanks and see you next time.

Want Early Access To Future Videos?

Pop your email address in the box below and receive new videos before everyone else!

<< Back to Insights