I have an album with only two images. One image is marked with a red flag.
I added a custom view-folder, that shows all the images that have been marked with a red or blue flag.
In the .htt template files of my skin I use the ${comment} variable to add the comment text. The comment text is used as a tooltip when you hover with the mouse over a thumbnail and as a caption below the photos.
This works fine for the two "normal" images, but for the image in the view-folder the comment text has changed to an empty string.
This is the code for a thumbnail in my template file (inside a <ja:fileiterator nodirs> loop):
<!-- Normal image -->
<% System.out.println("image") %>
<% System.out.println(" view-root: " + currentObject.getViewRoot()) %>
<% System.out.println(" file-name: " + fileName) %>
<% System.out.println(" title: " + title) %>
<% System.out.println(" comment: " + comment) %>
<% System.out.println(" date: " + originalDate) %>
<a class="thumb"
data-fancybox="gallery"
data-caption="${comment}"
href="${imagePath}">
<img class="thumb-image" src="${thumbPath}" alt="${fileName}" title="${comment}">
<br><span class="thumb-title">${fileTitle}</span>
</a>
I inserted some System.out.println() commands to see what is happening.
This is the result in the System console:
Making "Grenspalen-3" (Changes)
image
view-root: null
file-name: 000-20210712_115818.jpg
title: 000
comment: Rotonde bij Witte Huis
date: 2021-07-12 11:58
image
view-root: null
file-name: 181be-20210712_133458.jpg
title: 181be
comment: Paal 181-be bij Eupen
date: 2021-07-12 13:34
image
view-root: /Custom filter view
file-name: 000-20210712_115818.jpg
title: 000
comment:
date: 2021-07-12 11:58
"Grenspalen-3" made in 2,904s
Why has only the comment text changed to an empty string when the image 000-20210712_115818.jpg is processed the second time?
The same problem occurs in other view-folders, like Alphabetical view or Date view.