Hot answers tagged

1 vote

How to get the image from the last matrix block using twig's last filter

Your original (Craft 3?) code should have been throwing deprecation errors in the control panel (Utilities > Deprecation Errors), because you haven't executed your Element Query (entry....
user avatar
  • 3,924
1 vote

How to get the image from the last matrix block using twig's last filter

Found how to do it on Craft 4. {% set numberOfBlocks = entry.homeHeroBanner.count() %} {% set lastBlock = entry.homeHeroBanner.all()[numberOfBlocks - 1] %} {% set lastImage = lastBlock.backgroundImage....
user avatar
  • 21
1 vote
Accepted

Matrix field entry link corrupted

You're outputting an unexecuted Element Query. To clarify - the thing stored in your Entries field named buttonLink is not a Craft entry as you might expect, but is basically a raw unexecuted database ...
user avatar
  • 3,924

Only top scored, non community-wiki answers of a minimum length are eligible