Gallery improvements

Posted on December 6, 2023 by: Rob van der Linde
Filed under: Announcements, Developments
Tags: wainuiomata, website, gallery

We've improved the performance of the gallery by backporting some of our location pages changes. This has made the gallery pages both faster and easier to edit.

While adding support for attaching a list of photos to a location page, I was experimenting with different ways of doing this so that the person editing it would get a good experience.

Unlike the Gallery which up to now required sub-pages to be created, which then had the side effect of not being able to edit an album all on one page. Although we had scripts for automating the creation of these sub-pages like "import images from collection" which used Wagtail collections, it still wasn't the easiest to edit in the end and that was mostly because it wasn't all on one page.

So with the location and other directory pages I wanted to avoid doing this, so I actually tried a pretty simple solution. A Wagtail "stream field" with only one block type that can be inserted, a struct block with an image, a description and optional alt text. If the alt text is missing, it can fall back to the title for example, that is why it is optional.

Gallery Admin Page

The advantage is that it makes it a lot easier to edit AND it makes it faster. It does reduce the total page count by quite a lot as well.

comments powered by Disqus