WordPress - Gutenberg Splitter System
This explains the need for an amendment to the Gutenberg Editor system to suit building a website utilising a custom theme and our own unique design and layout.
WordPress Gutenberg Editor - blocks based system
The WordPress Gutenberg Editor is a blocks based editor system which has many great features. A customisation of this system is needed to make it more usable with a custom theme based on our own design and responsive layout. This is based around the fact that the Gutenberg blocks are one single set of content. It would be great if we could split this into x sections of data that we could place into areas of our own custom responsive layout templates. So I created a Gutenberg Splitter System utilising a class within the custom theme that allows us to use a splitter tag block to separate the overall Gutenberg content into smaller sections for our page layout.
User Viewpoint
We can setup a template that can be used to create, for example, a three column page layout using the content from the Gutenberg blocks.
When creating a page the user can choose the "Gutenberg Content Splitter - Three Column Layout - Page" template. Then content blocks are added as normal via the Gutenberg Editor.
To separate the content into the three columns of the page layout the user can add a Reusable block called "Gutenberg Splitter Block". Any content after one of these blocks will be moved to the next column.
This allows the user to build up all the content for the page columns with the Gutenberg Editor and have them display in the respective three columns of the page layout - but with minimal changes to the system in order to do this.
Technical Viewpoint
WordPress Gutenberg - Regular content system
To use the Gutenberg Editor system as it stands we have to use the set of data that it creates as well as additional data from an alternative editor.
Up to now we have used a system where we use the Gutenberg blocks data for the main column of the page. Then we setup ACF Custom fields (WYSIWYG Editor) for any additional page columns. These are like the old Classic Editor system.
This is not ideal as the user has to use two systems to add the content to the page. Also the classic system is harder to use to format data as it uses a single WYSIWYG area. It is much cleaner to use Gutenberg blocks for all columns/areas of the page.
WordPress Gutenberg - Content Splitter System
We use a splitter block to separate the content flow. This block essentially contains a splitter TAG. We can then use this to separate the content into sections that we can store and display in different columns/areas of the page.