• Resolved hatschiii

    (@hatschiii)


    I created a block which works exactly like the default image block, just added some styles.

    The point is, that the default image settings in the right pane are not there. Any idea how to get them?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter hatschiii

    (@hatschiii)

    no one an idea?

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @hatschiii,
    Thanks for bringing this up, and I hope you’re having a great weekend.

    The Image field in Block Lab doesn’t have setting like the Core Image block has in the Inspector controls (on the right):
    https://cldup.com/UYZ6ulKSrv.png

    But you can get a different size image with block_value() and wp_get_attachment_image_src(), like:

    
    $field_name = 'example-image-field-name';
    $image_id   = block_value( $field_name );
    $src        = wp_get_attachment_image_src( $image_id, 'medium' ) // Or another size, even an array() of width and height.
    
    • This reply was modified 5 years, 2 months ago by Ryan Kienstra.
    Thread Starter hatschiii

    (@hatschiii)

    Thanks for getting back Ryan.

    Why does the fields like the image fields doesn’t contain the default inspector controls?

    What I need is the inspector control to change the image size case by case. Is there any chance to get the inspector controls?

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @hatschiii,
    Unfortunately, the image field doesn’t use the code from the Core Image block, and it doesn’t have the controls to change the size in the Inspector.

    What I need is the inspector control to change the image size case by case. Is there any chance to get the inspector controls?

    Sorry, that’s probably only possible when using the Core Image block, not with Block Lab.

    Thread Starter hatschiii

    (@hatschiii)

    Thanks Ryan… that’s sad to hear

    @sven74Muc: But you can implement these fields by yourself in the block…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom Image Block’ is closed to new replies.