5

I'm building a site that makes heavy use of the Matrix field, which overall has been great. The one problem I'm running into is that I find myself duplicating a lot of Matrix blocks.

To use the documentation as an example, you see block types such as heading, pull quote, image, etc. Building out a complex site, I find myself using these common types of blocks in various matrixes(matricies?) and the only way I've found to do so is literally to just type the same thing over and over, which leads to more time and potential inconsistencies, not to mention the maintenance.

Obviously I could just define one large matrix field and put it everywhere, but I'd like to have more control than that across different pages. Is there a way to reuse these components or perhaps a different style that is recommended?

Similar question here, but I'm specifically asking about entire blocks, not individual fields.

6

A few options to consider:

  1. Use one big Matrix Block and a plugin such as Pimp My Matrix to get added control over which blocks display in which channels and various other details.

  2. If you find yourself reusing the same Matrix Patterns from site to site, consider a plugin that can help you manage reusable schema such as Sprout Import or The Architect, both plugins let you define your schema in a JSON format that you can tweak and import multiple times.

  3. I'll add this here as a third option as I think it's relevant for consideration but it probably doesn't address your question about reusing blocks: Consider using a plugin like Neo which takes a Matrix-style approach but let's your blocks use global fields which you can reuse as well as several other features.

2

Check out the NEO plugin which is basically Matrix on steroids.

  • Can't decide if it does exactly what I'm after, but cool suggestion. – aw04 Oct 26 '16 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.