Destination Full-Site Editing��All the Steps Monmouth University Took �to Prepare for the Future of WordPress
Steve Graboski (he/him)
Full-Stack Developer
Marketing and Communications
www.monmouth.edu
Rebuilding our WP Theme (2021-2022)
www.monmouth.edu
6/29/23
Interconnected Nav, prints via Full-Site Editor
Isolated Menus (2015)
Connected Menus (2022)
www.monmouth.edu
6/29/23
Site Editor (aka, Full-Site Editor)
www.monmouth.edu
6/29/23
Simple Edits, No Codebase Changes Required
www.monmouth.edu
6/29/23
Easily Change Static Parts of Template
www.monmouth.edu
6/29/23
You Can Create and Edit �Full Templates
www.monmouth.edu
6/29/23
What’s with These New Template Files?
www.monmouth.edu
6/29/23
It’s all Blocks!
www.monmouth.edu
6/29/23
�<!-- wp:post-content {”layout”: {“type”:”constrained”}} /-->
How We Accidentally Prepared for FSE
www.monmouth.edu
6/29/23
Show of hands! (Even if you’re at home!)
www.monmouth.edu
6/29/23
Why Prepare Now?
www.monmouth.edu
6/29/23
2017: Gutenberg
www.monmouth.edu
6/29/23
Old Editor: Text Focused
www.monmouth.edu
6/29/23
Block Editor: Block-Focused
www.monmouth.edu
6/29/23
Way More Options Than Before!
Text Blocks
Layout/Design Blocks
www.monmouth.edu
6/29/23
Media Blocks
Easy Customizations
www.monmouth.edu
6/29/23
The First Step: Dabble
www.monmouth.edu
6/29/23
Oct 2017: Post-Dabble
www.monmouth.edu
6/29/23
Step Two: Transition to Block Editor
www.monmouth.edu
6/29/23
2019: Our University Magazine, Monmouth
www.monmouth.edu
6/29/23
A Few Extra Blocks
www.monmouth.edu
6/29/23
The Third Step: Building Blocks
www.monmouth.edu
6/29/23
Designing Blocks
www.monmouth.edu
6/29/23
Consider a “Presentation” Block
www.monmouth.edu
6/29/23
First Big Thing: Describe the Attributes
attributes: {
featured: {
type: ‘boolean’,
default: false
},
title: {
type: ‘string’,
default: ’’
}�}
www.monmouth.edu
6/29/23
Second Big Thing: Manipulating Attributes (JS)
<div>
<ToggleControl� label=“Is This Featured?”� checked={ attributes.featured }� onChange={ () => {� setAttributes( {� featured: !attributes.featured� } )� } }� />
</div>
www.monmouth.edu
6/29/23
Deciding How to Show your Block to Readers
www.monmouth.edu
6/29/23
2019 to Now: The Block Editor Rules
www.monmouth.edu
6/29/23
Accordion (Shortcode)
www.monmouth.edu
6/29/23
Accordion (Block)
www.monmouth.edu
6/29/23
Contact Block (More Advanced)
www.monmouth.edu
6/29/23
Contact Block (More Advanced)
www.monmouth.edu
6/29/23
Step Four: Closing the FSE Gap
www.monmouth.edu
6/29/23
Theme Blocks in Action: Post Content Block
www.monmouth.edu
6/29/23
�<!-- wp:post-content {”layout”: {“type”:”constrained”}} /-->
Archive Templates: Simpler than in PHP!
<!-- wp:query -->
<div class="wp-block-query">
<!-- wp:post-template -->
<!-- wp:post-title {"isLink":true} /-->
<!-- wp:post-excerpt /-->
<!-- /wp:post-template -->
<!-- wp:query-pagination -->
<!-- wp:query-pagination-previous /-->
<!-- wp:query-pagination-numbers /-->
<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->
</div>
<!-- /wp:query -->
www.monmouth.edu
6/29/23
Adding Template Parts in Block Templates
<!-- wp:template-part {
"slug":”preheader",
} /-->
www.monmouth.edu
7/2/23
<!-- wp:template-part {
"slug":”header",
} /-->
<!-- wp:template-part {
"slug":”footer",
} /-->
You Can Replace PHP Templates Bit-by-Bit
Notice: PHP and Block Templates
www.monmouth.edu
6/29/23
Building Your Own Theme Blocks
www.monmouth.edu
6/29/23
Alert Block (2022)
www.monmouth.edu
6/29/23
SuperNav, Breadcrumb Blocks (2022)
www.monmouth.edu
7/4/23
SuperNav in preheader.html (template part)
<!-- wp:group {"className":"mobilenav-body"} -->
<div class="wp-block-group mobilenav-body">
<!-- wp:mu/supernav {"theme_location":"sidebar"} /-->
</div>
<!-- /wp:group -->
www.monmouth.edu
7/2/23
Requirements for Block Building
www.monmouth.edu
6/29/23
Strong Recommendations (Don’t Fret)
www.monmouth.edu
6/29/23
JSX and ES6 Plain JS
<InspectorControls>� <Panel>� <PanelBody>� <PanelRow>� <ToggleControl />� </PanelRow>� </PanelBody>� </Panel>�</InspectorControls>
wp.element.createElement(
InspectorControls,
{},
wp.element.createElement(
Panel,
{},
wp.element.createElement(
PanelBody,
{},
wp.element.createElement(
PanelRow,
{},
wp.element.createElement(
ToggleControl,
{)
)
) […]
www.monmouth.edu
6/29/23
A Free Plugin to Get Started: �Block Environment
www.monmouth.edu
6/29/23
Thank You!
Steve Graboski
Full-Stack Developer
Monmouth University
(https://www.monmouth.edu)
Linkedin | Github: @SJGraboski
Feedback: Link in Schedule
Block Environment (GitHub)
www.monmouth.edu
6/29/23