Custom Fields
Support Meta Box Builder Image Size Using Twig / Block Builder

  • Creator
  • #22540
    Resolved David Newton

    This should be pretty simple, but we're still not quite finding how to make it work. We just need to control the size of an image that is being added via a field and then rendered with Twig.

    If we load it as {{ single_image_psweo3wlxf }} then it loads a thumbnail size image. How do we load it as some other WordPress/custom image size?

    Thanks for your help!

    David Newton

Viewing 3 replies - 11 through 13 (of 13 total)
  • Author
  • #27043
    Long Nguyen

    Hi Robert,

    Can you please share the code that creates the block and custom fields? I will take a closer look and check it on my site.



    This is the part of code, that works but displays only small thumbnail:

    <div class="wp-block-column is-vertically-aligned-top" style="flex-basis:25%">                <figure class="wp-block-image size-large">{{ zdjecie_produktu }}</figure>

    What I want to do, is use medium image - thats what I tried, but it does not work:

    <div class="wp-block-column is-vertically-aligned-top" style="flex-basis:25%">                <figure class="wp-block-image size-large"><img src="{{ zdjecie_produktu.medium.url }}"></figure>

    The field 'zdjecie_produktu' is just a regular 'Single Image' custom field, thumbnail size is set to 'Medium'. No other customizations are made.

    As I mentioned, when I try to output the complete array, I just get '1' as the output.

    Long Nguyen
Viewing 3 replies - 11 through 13 (of 13 total)
  • You must be logged in to reply to this topic.