Adding the Classic Editor to a Gutenberg Block Template
-
NOTE: Here is a video that helps explain my question: https://drive.google.com/file/d/1c3pS-j8yq75GAwGDrrMMh9X7fDrCKV5R/view?pli=1
I am creating a custom post type that includes a set of blocks as a template. My basic code looks like this:
function register_article_post_type(){ $post_settings = array( 'label' => 'Articles', 'public' => true, 'show_in_rest' => true, 'template_lock' => 'all', 'template' => array( array( 'core/heading', array( 'placeholder' => 'Add Categories Heading...', 'className' => 'tour_categories_heading' ) ), ) ); register_post_type('article', $post_settings); }
That will create a Custom Post Type called Articles which has a singular Heading block. The thing is, I don’t want a heading block, I want the Classic Editor block.
But I can’t figure out how to add it. I can easily change the Heading block to a different block (say the paragraph block) if I change
array( 'core/heading',
toarray( 'core/paragraph',
.But when I check the code in Gutenberg for the name of the Classic editor, nothing shows up. As such, I cannot figure out how to add a Classic editor to the custom post type.
Any ideas.
- The topic ‘Adding the Classic Editor to a Gutenberg Block Template’ is closed to new replies.