Image cropping placeholders not set

Hi everyone,
I’m trying to implement image cropping with ContentBlocks, and I’m running into an issue where the crop placeholders (like [[+crops.small.url]]) aren’t returning anything.

The setup seems correct:

  • The cropped images are actually being generated in that folder.

However, [[+crops.small.url]] shows nothing.

I have this on chunk because I need to perform some extra validations and conditions before displaying the image.

MyChunk

<div class="g-gallery--secondary__item [[-+idx:gt=`9`:then=`g-gallery--load`]]">
            <a href="[[~[[+link]]]]">[[+size]]
              <img src="[[++imgix_url]][[+image:default=`[[cbGetFieldContent? &field=`100` &resource=`[[+link]]` &tpl=`cb_project_thumb_tpl` &wrapTpl=`thumb_wrapper`]]`]]" alt="[[+alt_text]]">
              <img src="[[++imgix_url]][[+image_hover:default=`[[cbGetFieldContent? &field=`100` &resource=`[[+link]]` &tpl=`cb_project_thumb_hover_tpl` &wrapTpl=`thumb_wrapper`]]`]]"  alt="[[+alt_text]]">
              <p>[[pdoField? &id=`[[+link]]` &field=`pagetitle`]]</p>
            </a>
          </div>
          <img src="[[+crops.small.url]]" />

I have this on the fileld coonfiguration inside a repeater

I’d love to know if there’s a recommended way to access crop URLs from within a chunk (maybe through a snippet or different syntax?), or if these placeholders are only available inside the field’s output scope.

Thanks in advance for any help or tips!

Hi Yuliana,
[[+crops.small.url]] have value only inside Image field definition. If your template for that field is inside chunk, you need to pass it’s value to that chunk like this:
[[$MyChunk? &crops-small-url=`[[+crops.small.url]]`]]

Inside chung use:
<img src="[[+crops-small-url]]" />

I have used crops-small-url, not sure if dotted syntax would work as chunk parameter.

Thanks so much! I’ll test this approach and follow up once I’ve tried it out.