Drupal Planet

Cloning Content in a LocalGov Drupal website

Beautifully crafted digital products and experiences that matter.

This week as part of my "Editor Experience" work for LocalGov Drupal, I worked on creating a feature to allow editors to clone pages of their sites.

Need LocalGov Drupal services? Give Big Blue Door a shout.

I spent last week and this week working mostly on editor experience issues for LocalGov Drupal. Last week was small bug fixes and features, and this week I spent my time getting a new module created that would do two things:

  1. Allow site owners decide what content types could have their content cloned, and
  2. Allow site editors to then clone pages from those content types.

This is a feature request that councils have been asking for for quite a while.

Why Clone Content?

Often on a council website you could have a lot of events and you might want to have all the same info for the events, but a different date, image, and signup link. Being able to clone a default event is a great time saver in this case.

You might also have a number of landing pages which can be time consuming to create - banner, related links, quick links, etc. In terms of consistency it's very handy to be able to create a template landing page, then clone it each time you need a new one.

How does it LocalGov Replicate module work?

It's quite simple. You install the LocalGov Replicate module - available via composer require localgovdrupal/localgov_replicate. Then go to the settings page admin/config/content/localgov-replicate, choose what content types you want editors to be allowed to replicate.

Now when you visit any nodes of these types, there will be a new tab (besides the "View | Edit | Delete" tabs) called "Replicate". When you click on that it will:

  1. Create a copy of the current page, and
  2. Bring you to that new version of the page so you can start editing it, and
  3. Leave the new page unpublished until you are ready to publish it.

Node Clone Vs Entity Clone Vs Replicate

We chose the Replicate module to use for this feature. Node clone will only clone nodes and we might in the future want to clone more entities, such as custom entities.

Entity clone will clone entities, but would clone the each entity on the page at the same time.

Replicate is an API-first module, without a UI (you can install Replicate UI if you want), but gives us full control over everything we want to do with our cloning feature.

Is it feature complete?

Nope, not by a long shot. 

I have one major issue with it at the moment, which is that the "Replicate" tab is showing up for all content types no matter what you choose on the settings page. 

Once I get that solved, I need to see what happens when you clone nodes with media and other entities in them. I guess we want to reference media, taxonomy, etc, but we want to clone paragraphs. Then we've the trickier question of reusable paragraphs in our "Page Components" module which I guess we also want to reference rather than clone, so if we update for example an address, it will update everywhere.

Thanks to Big Blue Door for sponsoring my time to work on this.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending October 4th, 2024

Beautifully crafted digital products and experiences that matter.

This week, I spent my time mostly looking at issues tagged with "Editor Experience".

Need LocalGov Drupal services? Give Big Blue Door a shout.

Meetings and Meet-ups

  1. Merge Tuesday: We still don't have LocalGov Base 1.7.0 released, but are very close once we get the adjacent PRs for LocalGov profile and Microsites profile all merged at the same time. Hopefully we'll get there by the end of the week.
  2. Accessibility Meetup: Maria from Agile Collective gave a really good presentation about the use of colour on our websites. And we recorded it, so do go watch it back.
  3. Tech Group Drop-in: I hosted the meeting again this week - I'm getting used to that now - and we talked about facets, carousels, and default themes for microsites.

Code Contributions

  1. We've been going around and around with an issue for moving the "Files" tab from the content tabs list to the media tabs list. We decided at the Product Group meeting last week to add an update hook to move it for existing sites as well as new installs, and create release notes to let people know why. So ... that's done now, hopefully we'll get it merged at Merge Tuesday tomorrow.
  2. Another kind of lingering issue was adding masquerade module vs msqrole module to our default installation. At the Product Group meeting last week we decided to go with masquerade module since it now has security team coverage and is the preferred choice from the Drupal Startshot initiative. With that being the case, we now have a PR for this.
  3. I updated last week's PR to enable the LocalGov Base Helper module for LocalGov Microsites Group, so it now does it via an update hook instead of in the info.yml file.
  4. I enjoyed spending some time this week researching solutions for a "What other pages on my site link to this page?" feature that we want to add to LocalGov Drupal. What wasn't quite so enjoyable was my findings - a module to do what we want, in the way that we want it, does not exist.
  5. Alistair Wearing has written a nifty PR for us to add the icons for accordions via Twig templates instead of JS so it is much easier to override and maintain if you want to. Once we get that merged, I've a few follow-up issues I'd like to consider as well - such as placing the title of the accordion inside the button and placing the icon for the accordion outside the button.
  6. Our 1.7.0 release of LocalGov Base is going to have a helper module along side it, so we can have update hooks in themes, basically. But this is needing a lot of coordination between the default profile the default theme the microsites profile and the microsites theme. After a lot of reviewing of a PR on microsites, it looks like we're just about there now.
  7. Paul McCrodden has been helping us out with some PRs, working through some of the "Good first issue" items to get himself up to speed with how we work. It's been great to mentor him and help him find issues to work on, and even approve some of his PRs. Thanks Paul.
  8. And that then got me thinking about a larger clean-up issue for us - use logical properties for all our CSS. This will mean a smaller codebase to maintain, but also an easier codebase to maintain. No more [dir="rtl"] styles.
  9. We are working hard on "Editor Experience". One issue was trying to make it easier to link to documents from your media library. I've created a PR for this now, so you can add simple links to documents. If you want a more complex display of the document (including metadata, etc) you can still do that via the standard media embed.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending September 27th, 2024

Beautifully crafted digital products and experiences that matter.

I spent a lot of time this week working on LocalGov Base. It's great to have a strong core that all other themes can build upon.

Need LocalGov Drupal services? Give Big Blue Door a shout.

Meetings and Meet-ups

  1. Merge Tuesday: We had a monster mash of reviewing and merging LocalGov Base code after all the PRs I got created yesterday. I love seeing issues being created, fixed, and merged so quickly.
  2. Product Group meet-up: So many cool things coming up in LGD. Today we talked a lot about our on-going "Editor experience" mission.

Code Contributions

  1. My old friend Paul McCrodden has just joined us and is starting to help us out with some of the issues on GitHub. It was great to spend some time getting him up to speed and doing general mentoring work to find issues for him to work on.
  2. Having spent all of last week working on the LocalGov Live Preview module, my GitHub notifications were well-amassed this week, so lots of time was spent on issue triaging and responding to comments/issues/PRs.
  3. We had been printing the navigation for step-by-steps and guides in our print.css. Jonny reckoned we should not be printing these items and created an issue for it. I agreed with him, so created a PR to remove them from the print stylesheet.
  4. Maria created an issue to let me know that when you create a blockquote via the WYSIWYG, there is no styling added to it so people may not know it is a quote. This seems like something easy to fix, except we also have a "Pull Out Quote" component which creates a blockquote and that does have CSS for it. The conundrum is then how do we style general blockquotes, without affecting our pull out quotes? I think I got a pretty-elegant solution.
  5. Another tricky accessibility issue was created by Lauri, saying that the quick fact component does not have a proper semantic hierarchy. This showed up two issues for me - I'm not sure what any particular item in the quick fact component should have for it's semantic element besides p and we thought we were printing the main content of it in a p but weren't. We now have a PR to fix that, but I feel we might need more discussion to figure out if a more specific element would be more appropriate.
  6. Some of our JS code was written at a time when we were explicitely supporting IE11. We have moved on from explicit support to "let's not intentionally break it" support, so I'd like to start getting our transpilers and *.es6.js files removed. This will mean we'll serve more modern JS but also mean it will be a lot easier for people to contribute to the project since they won't have to get set up with transpilers and polyfills. Here's a PR to show what I mean for LocalGov Alert Banner module.
  7. The "View map" link on service landing pages opens in a new tab, which can be disorientating for people, especially screenreader and assistive technology users. Maria created an issue for this, and I created a PR for screenreaders to announce that it is an external link and also that it opens in a new tab.
  8. We got the large PR to add a sticky header feature to LocalGov Base merged at last, and also a corresponding PR in LocalGov Core to enable a LocalGov Base helper module, but after that we realised we need to come up with a similar strategy for LocalGov Microsites. So ... that's thrown a spanner in the works. Hopefully a PR for LocalGov Microsites Group module will suffice to fix this issue.
  9. Our step-by-step pages show sighted users which step is the current step in the sidebar navigation. However, we don't give the same affordance to non-sighted and screen reader users. Well, we used to not, but now we do!

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

Need to hire Drupal developers? I can help you

The Confident - LocalGov Drupal Agency - Logo

Today I launched a new service, matching available Drupal developers with recruiters and agencies that are hiring.

I am often asked by people looking for work if I know of any one that is hiring.

I am also often asked by people who are hiring if I know of any Drupal developers looking for work.

The answer to both is usually "Yes". I seem to know lots of people in the Drupal community and am trusted enough by them to let me know if they are looking for a new job/contract (often in private so their current employer doesn't know).

Last week I sent contact details of two very good Drupal developers that I know personally to a recruiter. I know at least one of them is being interviewed this week. But then I had a brainwave! Why am I doing the work of a recruitment agency for free, especially when I know how much recruitment agencies charge for their services.

A new Drupal recruitment agency?

My solution? I am going to charge people who are hiring, just like a recruitment agency would, for my recommendations. Except, my cost is going to be about 90% cheaper than a recruitment agency. Why so cheap? The price I am charging is a very fair price for basically telling someone that someone else is available for work.

I am calling this service "Available Drupal Developers". If I was cool, I'd call it ADD or something and set up a website and a CRM, and get some merch and hoodies, and blah, blah, blah. But I'm not cool, so I am keeping it all in a spreadsheet for now and a landing page on this humble website.

How much does it cost?

I've a simple pricing model. If you hire a developer that I recommend, the cost will be €1,500 per developer. No deposit, no recurring charges, no "18% of their first year's salary", just a simple one-off fee of €1,500 (ex-VAT, if applicable). If you are a developer, there is no charge.

Is there a vetting process

I'm keeping this simple. I'm only prepared to recommend people who can pass this threshold:

  1. I know you personally (have worked with you, worked on issues together on Drupal.org, met at conferences, etc) and/or
  2. I can validate your work from open source sources (blog posts, presentations, Drupal, GitHub)

Take my money already, Mark

If you are looking to hire a Drupal developer, get in contact and I'll see if any of the 40 people I currently have on my list would suit you (that 40 will be significantly reduced soon as I make my way through vetting people).

I'm available for Drupal work

If you are a Drupal developer thinking of changing jobs, fill out this form and I'll see if I can recommend you to someone suitable.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending September 20th, 2024

Beautifully crafted digital products and experiences that matter.

Do one thing, do it well - this week I spent most of my time creating a live preview module for microsites.

Need LocalGov Drupal services? Give Big Blue Door a shout.

Meetings and Meet-ups

  1. Merge Tuesday: Great meeting today discussing getting a stable release of LGD microsites released, and also our process for adding new features to LocalGov Drupal.
  2. Government Design System meetup: This was my third time representing LocalGov Drupal at the Government Design System meetup. This time we talked about performance measurement - how do we measure the success of our design system.
  3. Community Meetup: We had a very informative meetup this week, discussing the new Job Vacancies module as well as myself and Finn presenting our "Live Preview" work.
  4. Tech Group Drop-in: As usual, a very lively chat. This week Netcall integrations and SSO were on the agenda.

Code Contributions

I created a LocalGov Live Preview module to work with the microsites platform, which took up all my time this week, and encouragingly got a great response at the community meet-up. 

I think this is going to be a game-changer for how councils and others put their microsites together. No more "make a change, click save, refresh page, rinse, repeat". Now you can see all the changes happening live.

Here's a video walkthrough of it:

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

Live Previews for LocalGov Microsites Design Changes

Live Previews for LocalGov Microsites

I had great fun today expanding what was a proof-of-concept module from last year into a very usable live preview module for LGD Microsites.

Last year I made a module as a proof-of-concept for live previews for LocalGov Drupal Microsites. Today, I spent the day taking it out of "proof-of-concept" mode and getting it into shape as a fully functional module.

I'm pretty happy with the results so far. I'll keep refining it a bit more as the week goes on.

Here's a short intro to it.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending September 13th, 2024

Beautifully crafted digital products and experiences that matter.

This week's big issue was building a prototype for "Axe Thrower" so we can "throw" multiple URLs at AXE at the same time.

Need LocalGov Drupal services? Give Big Blue Door a shout.

Meetings and Meet-ups

  1. Merge Tuesday: Another productive meeting. I'm especially happy with the merge to localgov_paragraphs to add the new "Show all" accordions widget.
  2. Content Group: We had a great chat about what people are enjoying about LGD - microsites, subsites extras, and replicate all came up. And a WHOLE LOTTA Love for Miro.
  3. Tech Group Governance: Nice to get to this monthly meeting. Today we discussed stabilising microsites, preparing for Drupal 11, and the community fund.
  4. Tech Group Drop-in: Lots (and lots and lots) of talking about maps, maps, and mapping.

Code Contributions

  1. We're preparing for Drupal 11 support, so the week began with reviewing/approving PRs for some of the items that I maintain - LocalGov Sa11y, LocalGov Scarfolk, LocalGov Base, etc.
  2. Most councils want a "Feedback form". Those small forms that say "was this page useful?" and ask you to give some details if it wasn't. Here's a PR to create that feature. Remind me to stop creating forms, they're tricker little things.
  3. I love when we get accessibility issues submitted for LocalGov Drupal. It means when we fix them, we make the web better for everyone. Bisd posted one recently about our "Read more" for service status pages not being translatable. After a little bit of investigating, it turns out it was translatable, and we also have a corresponding aria-label to be more expressive for people using assitive technology.
  4. The "move components to single-directory components" issue is moving along very nicely. Just one tiny comment or two from me to Christopher and then I think we're good to go.
  5. We've been discussing our approach to checking if a region is empty before rendering it for the past few weeks. What we currently have might has an effect on caching (it's a long-running Drupal core issue too). But any solutions to it throw up other issues as well. I tried, and have nearly succedeeded, in a CSS-only answer to it, but I'm stumped on the if/else clauses for sidebars in the page.html.twig file. If you'd like to contribute to the conversation, please do.
  6. Will mentioned that it might be helpful for editors to more clearly see what heading levels that have used in the wysiwyg. I put together a quick proof of concept to show how we could achieve this with just some simple CSS.
  7. We have an open issue in the LocalGov Sa11y module to prevent sa11y from running on wysiwyg fields. After a bit of testing, it turns out it already does not run on ckeditor fields. It only runs on rendered content, not editing content, and only runs on the frontend, not while viewing an admin theme. And even testing it on the frontend by creating a comments field showed it was working as expected. We now no longer have this open issue.
  8. Last week at the LocalGov Accessibility Meetup, Michael from Big Blue Door gave a really interesting talk about automated accessibility tools, which allow you to scan a page to automatically detect accessibility issues. One of the questions that came up was if you can scan more than one page at a time. I put together a demo repo of code to show how this can be done, then made a video to explain it, and a blog post too.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

The Confident: Mark Conroy's new Drupal agency

The Confident - LocalGov Drupal Agency - Logo

I've got some big news.

I've just started my own new agency. 

It's called The Confident, with a tagline "For those who demand the impossible". Yep, we're not afraid to take on extremely challenging projects and see them through to completion.

Starting off, we will have a hyper-focus on the Local Government market, specifically LocalGov Drupal. I see us as being complementary to the existing agencies in this space, offering 4 services:
 

  1. Figuring out what a council wants for a new website or feature on an existing site.
  2. Helping them source the best placed agency to work on this project.
  3. Being a link between the council and this agency to ensure the project is a success.
  4. Co-pitching with other agencies to win big contracts


If you think any of the above could be of interest to you, I'd love to have a chat.

As well as the above, we have a line of products that we plan on launching. The first of which will be coming next week. Stay tuned!

The Confident

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending September 6th, 2024

Beautifully crafted digital products and experiences that matter.

One of those weeks where we got lots and lots of smaller issues cleared up, and a new module released, and a very quirky bug discovered.

Need LocalGov Drupal services? Give Big Blue Door a shout.

Meetings and Meet-ups

  1. Merge Tuesday: Lots of talk this week about supporting Drupal 11 and what we need to do for our automated tests to work for it, while also supporting Drupal 10.
  2. Accessibility Meetup: Michael from Big Blue Door gave a really interesting presentation on the tools he uses for checking the accessibility of their websites, notably Axe, Wave, and Lighthouse, as well as manual testing and keyboard navigation testing.
  3. Tech Group Drop-in: We had two big juicy topics today, nice to get down and dirty with tricky stuff - media downloads and empty regions + caching.

Code Contributions

  1. Christopher had a really nice PR created for me to test on Monday morning. The PR would allow our accordion patterns to have more than one item open at a time and also add a toggle to 'Show all/Hide all' accordions. Each of these features can be turned on/off for individual accordion containers. Very nice.
  2. Lee suggested that the LGD Dashboard I built a couple of weeks back should have a link for "Good first issue", so now it does.
  3. We've had an issue for a while now about removing the 'Files' tab from the list of tabs you see on the admin/content page. A lot of content editors are clicking on it expecting that's where their "Files" are, which it is, except what they are actually looking for is their "Media" items. We had a PR to remove this tab altogether, but that will break existing sites, and some users might want to visit it. So. we now have a PR to set the "Files" tab to be a sub-item of the "Media" tab. That makes sense I think.
  4. I had forgotten we had a module called "LocalGov Extra Layouts". Justine created it originally when she needed a 4-column layout, but we then added 4-column layout to the LocalGov Paragraphs module. The other layouts in the LocalGov Extra Layouts module are probably still useful to other councils - 33:66, 66:33, 2x2x2x2, etc. I did some work on these to close out an issue created by Andy saying the module had not been added to packagist (it is now, along with its own shiny composer.json file) - this was the issue that brought this module back to my eyes.
  5. Then I did some work to tidy up the code - fix the package name, tidy up the CSS, remove the redundant template, etc.
  6. LocalGov Extra Layouts had no release branch and no tests, so I created an issue to fix this and then a PR for it to use the shared workflows approach we have.
  7. What module would be complete without a README.md? Well, here's a PR for LocalGov Extra Layouts to now have one.
  8. Issue number 1 for the LocalGov Drupal Dashboard was to create a button that would copy the clone command for a repo to your clipboard. And now we have it.
  9. Whilst there, I did a little clean up of the table layout and the general cards layout.
  10. I had a good chat with Sarah from Blackburn with Darwen Borough Council and we think we've discovered a bug in the path alias settings for publications. I haven't got it fully uncovered yet, and I certainly don't have a fix for it yet, but I've some notes written up about it, and we'll get it solved from there.
  11. Following that call, I put together a video to demonstrate the bug. Hopefully that will help us to get a fix for it quickly.
  12. Zach posted a PR to link the SVGs on publication cover pages to their respective files. We got it reviewed and merged.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending August 30th, 2024

Beautifully crafted digital products and experiences that matter.

This week was all about catching up on notifications and open PRs from last week, and creating a mega amount of new PRs.

Need LocalGov Drupal services? Give Big Blue Door a shout.

Having spent most of last week's time working on the new LocalGov Drupal Dashboard, I had a bit of a backlog of issues, PR, notifications, etc on GitHub to read through, respond to, update. Not the most glamourous part of open source development, but you need to keep on top of the repos you are the maintainer for. And then ... a gem pops up. Christopher proposed a new module, built it, and put it on GitHub for us to review. The module is a jobs listings portal, something we probably should have built before now, but it's never too late.

Meetings and Meet-ups

  1. Merge Tuesday: We spent most of the MT time reviewing the 13 PRs I opened for the $is_syncing issue that I spent half of Monday working on.
  2. Tech Group Drop-in: This was a really juicy meeting this week, discussing Big Pipe/Cachability/Empty Regions/Supported CSS ... and some other items that were a little less taxing on the brain.

Code Contributions

  1. We have much better tabbing order now for keyboard users when tabbing from the services menu toggle to the services menu. Now when you get to the last item and click tab, it will tab back to the main menu area. Previously it was tabbing to the main content area. Better accessibility is better for everyone.
  2. Sticking with the theme of accessibility, Maria posted an issue demonstrating that headings in the footer regions were black on a dark grey background, failing contrast conformity for WCAG guidelines. So I created a PR to add variables for headings in footer regions, and we can then easily set these in our variables.css files for --color-pre-footer-heading, --color-footer-heading, and --color-post-footer-heading.
  3. Sometimes reviewing PRs is fun, for example when you get a MEGA pull request to update the docs site from VuePress 1 to VuePress 2. Thanks to Lee for creating this PR, it's not one I was relishing creating. 🙂
  4. Keelan opened an accessibility issue over a year ago where JAWS screenreader was reading out the decorative ">" symbol in our start buttons. We couldn't reliably reproduce/fix it at the time, but thanks to the nifty new CSS "alt text" property for the CSS "content" attribute, we now can. I created a PR for it, hopefully that's one more accessibility fix we'll have in our codebase soon.
  5. We've had an issue pop up a few times recently with config being imported and install hooks being run at the same time causing issues. We figured out it's because we are not sufficiently checking to see if config is being imported before we do our manipulations. Stephen created an issue for this, and then I created 13 pull requests to fix the issue everywhere it might arise. This was quite boring, but necessary.
  6. Erik posted a whopper of an issue, in great detail, showing some shortcomings we have in LocalGov base for trying to detect if a region is empty or not before we render it. We're using the same approach we created for the Umami theme in Drupal core, but no matter what you do something has to give - either we lose caching on some blocks, or we lose the ability to use Big Pipe on others, etc. I'm not sure exactly how we'll solve this, but I'm really looking forward to the conversation. Perhaps you can jump in to it too here.
  7. I've been making some moves to try standardise some of our components. The first I've been tackling is our "Previous/Next" component. We use the same thing on blogs, step-by-steps, etc but have different templates for them all. I have a number of them now using the same template. Thanks to Christopher for creating a PR to add publications prev/next to the list, which I reviewed and merged.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).