Adding blocks should stem from your child theme and be included in your seeds so that the original theme structure can be restored if needed. Follow the Seeding Themes documentation to seed your alterations to the blocks. You can edit the blueprints directly in the app/blueprints folder, but it's not recommended if you plan on updating the theme.
From this point forward, it is assumed that you are creating blueprints in your seeds folder and seeding it from there.
Adding Your block to The Builder
Adding your block to the builder and columns group
To add your block to the builder group, you'll first need to create your own mixin content blocks within the seeds/blueprints/content/mixins/builder/ folder.
The following assumes you created a custom_block folder inside the above folder. This folder should contain the following files
Once you've created your custom block blueprint files, you'll need to add them to the Section and Column areas which are in the builder.yaml and section.yaml blueprint files respectfully
builder.yaml
section.yaml
Once done, you should see your block within the builder after you run:
Displaying Block Content
Awesome, your block is in the builder. Now it's time to render it's content. You'll need to create some partials under builder/sections and builder/columns to prep the content for rendering.
builder/sections/custom_block.htm
The snippet above includes all the extra Advanced Tab content to get you started.
Next up, creating the column block
builder/columns/custom_block.htm
The columns block doesn't depend on any content inside of it, so you can initialize it without any extra content
Adding the blocks to the pages
Now that you've created the blocks, time to reference them in their respective sections
builder/items.htm
builder/sections/section.htm
That's it! You've successfully created a custom block. It's a good idea to use folders to organize all your custom blocks.
uuid: 1be4d611-a49d-11ed-9116-3a678152e91c
handle: Content\Section
type: mixin
name: Section
fields:
section_header:
type: mixin
source: Content\SectionHeader
tab: General
reverse_columns_on_mobile:
label: Reverse Columns on Mobile
comment: Useful if you have content that needs to be stacked a different way on a phone.
type: switch
tab: General
hr_1:
type: ruler
tab: General
columns:
label: Content
type: repeater
commentAbove: Create content for this section. Each content block uses it's own column. Max of 4 per section.
span: full
displayMode: builder
tab: General
groups:
#...
custom_column_block:
name: Custom Block
icon: icon-toggle-on
description: Your Custom Block Description
titleFrom: title
fields:
custom_column_block:
type: mixin
source: Content\CustomBlock
#...