Extract every image from existing asset fields from an entry or field recursivley including nested matrix fields.
This plugin requires Craft CMS 5.2.0 or later, and PHP 8.2 or later.
You can install this plugin from the Plugin Store or with Composer.
Go to the Plugin Store in your project’s Control Panel and search for “Image Extrator”. Then press “Install”.
Open your terminal and run the following commands:
# go to the project directory
cd /path/to/my-project.test
# tell Composer to load the plugin
composer require akukral/craft-image-extratcor
# tell Craft to install the plugin
./craft plugin/install image-extractor
In your Twig templates:
{% set entry = craft.entries.id(123).one() %}
{% set allImages = entry.getAllImages() %}
{% for image in allImages %}
<img src="{{ image.url }}" alt="{{ image.title }}">
{% endfor %}