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....
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....
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
matrix × 620templating × 82
craft3 × 60
plugin-development × 42
relations × 38
field × 38
entries × 37
assets × 33
entry × 22
block-types × 21
search × 19
loop × 19
blocks × 19
categories × 18
forloop × 17
plugin-supertable × 17
entries-field × 16
conditional × 15
control-panel × 13
localization × 12
datetime × 12
plugins × 11
fieldtypes × 11
database × 10
elementcriteriamodel × 10