iamntz / carbon-fields-urlpicker

Add an URL Picker field to Carbon
14 stars 18 forks source link

complex field inside gutenberg reusable block support #13

Open dunot opened 3 years ago

dunot commented 3 years ago
Block::make( __( 'About: Year reports' ) )
        ->add_fields( array(
            Field::make( 'complex', 'about_reports', __('Year reports', 'tt' ) )
                ->add_fields( array(
                    Field::make( 'image', 'report_image', 'image' )->set_width( 50 ),
                    ...
                    Field::make( 'urlpicker', 'report_url', 'URL' )->set_help_text( 'help text' ),
                ))
        ))
    ->set_description( __( 'Year reports' ) )
    ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {});

causes "This block has encountered an error and cannot be previewed." in admin page

iamntz commented 3 years ago

Hey @dunot can you tell me:

dunot commented 3 years ago

Hi, CF is v.3.3.0, using built-in Gutenberg (not plugin), outside Gutenberg (carbon fields for posts) causes no errors.

pospisk commented 3 weeks ago

@dunot I've just faced the same issue and solved it by running npm install in the carbon-fields-urlpicker folder as mentioned in the readme.

If you install it from the source, you need to make sure that you also run npm install and npm run production in order to have assets compiled.