Sprint 6 Notes - LocalGov Drupal: Microsites

Automated testing

Since the start of the LocalGov Drupal project we have been reasonably good at forcing ourselves (and each other) to write tests for important pieces of functionality, to reduce the chances of introducing bugs as we add code. The modular nature of the project has made this an interesting challenge and we are continuing to iterate on how we use Github to run tests.

We've build LocalGov Microsites as a separate distribution with its own installation profile, sharing many of the modules that we've build for LocaGov Drupal. This means we now need to test some modules against two installation profiles, and some just against one.

Stephen has refactored the testing script so we are now testing each Github project against the appropriate installation profile, so we are running coding standards, deprecation checks and PHPUnit tests on all pull requests.

Automated testing results on LocalGov Microsites

LocalGov Directories in LocalGov Microsites

The bulk of the work to bring the main localgov_directories feature into LocalGov Microsites was done last sprint, but we've written some automated tests and merged this in so that a default install now comes with directory channels, pages and venues.

Autosave form

A small but important feature for content designers is the autosave function provided by the https://www.drupal.org/project/autosave_form module. If you have ever spent time writing a piece of content only to accidentally close the tab or navigate away from the form and lose your work, you will appreciate the potential value of automatically saving a draft of your work. 

The autosave form module does this in a neat way. It saves a draft of the content at intervals (eg every 30 seconds) and the next time you edit a piece of content it offers you the choice to resume editing or discard the draft.

The number of times I've lost work on this site makes me think we should install it everywhere!

Shout out to Thunder Distribution for this one: https://www.thunder.org/autosave-thunder

Autosave form popup prompt

Header and footer styling

Mark and Maria did some great work extending the options for the styling of the header and footer, including new configuration fields to 

  • set alignment of header elements,
  • override font styles,
  • set alignment of footer elements,
  • control image styles for logos in footer.

Image styles choice for teasers per microsite

A site admin can now select a preset image style for teaser images. This allows different microsites to use different image styles for teaser listings. Nice!

Width selection for layout paragraphs

Another small but powerful feature is the ability for content designers to select the width of layout paragraph containers to allow content to 'break out' of the container.

Select width for layout paragraphs.

Preview and responsive preview

When testing with users, the ability to preview content came up a few times. This now works in two ways.

Firstly Drupal's native preview seems to work a bit better these days and allows a content designer to look at different display modes like teaser and search results as well as the full page.

Preview content with Drupal preview

The addition of the responsive preview module enhances this by allowing content designers to quickly see how the content will be displayed at different screen resolutions, even before saving their changes.

Responsive preview

Path aliases per microsite

Using Group and Domain module to serve content to multiple microsites is complicated. One complexity is that Drupal prefers to have unique path aliases. This presents a challenge if  both microsite 1 and microsite 2 want a page using the URL /about . Ekes worked some magic this sprint to support the same url alias on multiple microsites. The ability to automate aliases with Path Auto is still something we need to look at.

Meet the Authors
Back to blog