I would like to integrate a small and discreet area on each page that lists all images used on the page (not: all uploaded images) as thumbnail with copyright holder (the customer does not want to show the copyright notice directly in/under the image). Is there a possibility to automatically read out only the images used on the respective page?
Possible, yes, but not really straight forward, and depends how images are used on the site (in files fields, in block/layout fields etc.).
I agree with you and it makes the query complex.
It is easy to read out the whole folder. However, there are also some irrelevant images in there (logos, icons etc).
My solution: I will select the desired images with a selection field. This is manual work, but a compromise to reduce programming effort.
I attached the copyright as attributes to all elements as data attribute and then used a PHP XPath Query to aggregate the copyrights from the rendered page content. You can see it on https://www.kowa-leipzig.de/. However this implementation is highly specific to the site as it only resolves the main Blocks field there.
Thanks for your answer.
I have implemented the following solution:
In the panel, there is a tab for image management for each page. There you can select if you want to show image credits. With a “when” query a selection box appears to select all photos shown on the page. Logos or unused images can thus be ignored.
On top of that, an icon button appears in the navigation …
… to show a “hidden sidebar” with the images.
Additionally I integrated a lightbox and the author name still contains a link to the website of the image source (if specified in the image template).
I am very happy with this solution for my project, as it is discreetly placed and informative.