mysociety / fixmyblock-wordpress

1 stars 1 forks source link

Custom post type and templates for "action group" directory #50

Closed zarino closed 4 years ago

zarino commented 4 years ago

Fixes #39. Here’s how it currently looks, on my local machine, with a handful of groups and some "cover page" content:

Screenshot_2020-08-04 Groups – FixMyBlock(1)

Admins can now create "Groups" (a custom post type) which have a title, description, optional image, and URL, and will be listed at /groups with a search box and various filters. Groups also appear in the existing site search, alongside regular pages.

The title and page content displayed above the archive listing at /groups can be customised by creating a "Page" with a permalink of groups. The FMB theme will effectively combine both the archive listing page and this custom "cover page", so you get the best of both worlds. This isn’t a group-specific thing – it should work for all category/tag archives.

This is a fairly hefty feature that touches lots of bits of the site (eg: taxonomies, display of post types, post-list templates) so while I was there, I tidied up a few annoyances in related bits of code too.