Back in April 2022, Chicken and Hammersmith & Fulham's web team met up to plan the build of the new version of lbhf.gov.uk, on LocalGov Drupal (LGD).
One of the features that H&F really wanted was subsites, and they had some ambitious plans for how to use them, making the most of the content types and features that LGD gives you, like directories, guides, step-by-step pages, etc.
The only problem with this plan was that at the time, LGD's subsites worked in a way that expected you to use specific content types to build your subsite - there's a Subsite Overview page, and a Subsite page. You make your subsite out of the Overview page with some Subsite pages under it, and that's pretty much it.
What it can't do is things like:
- Let you add any of LGD's content types into a subsite.
- Add sub-pages into a subsite automatically. For example, if you add a guide overview page into your subsite, you'd want all the guide pages under it to be part of the subsite too.
- Work with Drupal's existing menu system to show styled navigation, or use any of the other modules that work with the menu.
- Let any content type be the homepage of a subsite. We didn't want to use the original Subsite Overview content type, so we made our own.
So Chicken made a module that could do all this for H&F and called it lbhf_subsites.
H&F made great use of it. For example:
These got noticed by the community, and people started asking how H&F's subsites work. Eventually, as part of the rebuild of essex.gov.uk onto LGD, we were asked if with Hammersmith & Fulham's consent, we could release lbhf_subsites back to the community so everyone could benefit from it.
Thankfully, H&F are excellent open source citizens, and were keen to contribute it back, so that's what localgov_subsites_extras is. It's already in use on Essex's site for their Fostering subsite. The open-source version of the module's already better than the original version we made for H&F, as it gets installed in more sites, bugs get found and other developers from other councils come back with some great suggestions for improvements and features.
So everyone's a winner here. H&F get their existing module improved by the community. Essex get a feature for a lower cost than developing it themselves, and also benefit from its ongoing development. And anyone else who uses LocalGov can install localgov_subsites_extras and get the same improvements. The module's already powering subsites in other councils' sites, like Dumfries & Galloway's subsite for Gretna Registration Office.
This work was part of the LocalGov Drupal Community Fund, so if you'd like to see more co-funding like this happen, you can contribute there to help sponsor new features for LGD.