This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 5 - Pages: 1 - Last Post: 21 Nov 25, 17:38 Last Post By: JeffTucker
palthe

Posts: 35
Registered: 27-Dec-2009
Comments are missing in view-folders
Posted: 20 Nov 25, 23:39
 
  Click to reply to this thread Reply
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.
JeffTucker

Posts: 8,062
Registered: 31-Jan-2006
Re: Comments are missing in view-folders
Posted: 20 Nov 25, 23:58   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
Difficult to say. I've replicated what you're doing, and it works for me. I added a red flag to one of the images in the project, created a custom view to pick up red-flagged objects, and its comment came with it. And it is within a <ja:fileiterator nodirs> loop, just like what you're doing.

But there's a more fundamental issue here. If you're doing a fileiterator loop, it should be dealing only with the objects in the current folder. And in a folder in a project, regular objects and view objects can't both be occurring. A folder can contain only all regular objects, or only all view objects. Remember, the view is a separate folder.
palthe

Posts: 35
Registered: 27-Dec-2009
Re: Comments are missing in view-folders
Posted: 21 Nov 25, 15:34   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Thanks for the reply. I hoped that I made some obvious mistake...

In my normal skin I have some functions that uses the comment, like a function to replace quotes by their html-codes and a function to combine the comment and the date into one "caption". I thought that they might cause the problem. But for the test I removed all those functions (I think...) but the problem persists.

About the iterations: In my skin I use two iterations, one <ja:fileiterator nodirs>loop for images and other files (audio, video, etc.), followed by a second <ja:fileiterator><ja:if category="folder"> loop for the folders.

In my test-album I only have a main page with two images and the view-folder.

https://palthe.jalbum.net/Test%20album%20with%20view/

Edited by: palthe on 21 Nov 2025, 15:36
JeffTucker

Posts: 8,062
Registered: 31-Jan-2006
Re: Comments are missing in view-folders
Posted: 21 Nov 25, 15:50   in response to: palthe in response to: palthe
Helpful
  Click to reply to this thread Reply
I believe you have simply failed to tell the jAlbum core that your custom skin supports internally-linked objects, and that's what is required for views to operate properly. The tip-off for me is that the thumbnail page for the custom view is pointing to slide image files within the view folder itself. The slide images for the view page should be a level above.

Here's a quick test album:

(demo album removed)

I've set it to display the comments on thumbnail hover, so you don't even have to open the lightbox to see them.

Take a look at the page source code. On the main page, you'll see the slide images referenced like this:
slides/1896%20Ford%20Quadricycle.jpg
But when you get to the view page, the slide references are like this:
../slides/1896%20Ford%20Quadricycle.jpg
In short, there is only one set of slide images, not a separate set for the main page, and another set for the view page.

It may be enough to put this line in the skin.properties file of your skin:
supportsInternalLinking=true
palthe

Posts: 35
Registered: 27-Dec-2009
Re: Comments are missing in view-folders
Posted: 21 Nov 25, 16:51   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Perfect!
Adding supportsInternalLinking=true to the skin.propperties file solved the problem.

I have read that to use views "the skin must support it", but I saw that the internal linking option in the settings (Advanced > General) was selected, although greyed-out. So I thought it was OK.

Just out of curiosity:
When would you want to disable this option? What are the disadvantages?
JeffTucker

Posts: 8,062
Registered: 31-Jan-2006
Re: Comments are missing in view-folders
Posted: 21 Nov 25, 17:30   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
palthe wrote:
Just out of curiosity:
When would you want to disable this option? What are the disadvantages?

I've got some specialty skins that simply don't support folders at all, views or otherwise.

But I think that if internal linking isn't supported, it might be wise if the core disabled the "add a view" functionality. With some skins, it might work, but at the price of replicating all of the thumbnails and slide images. But, as you've discovered, doing that also leaves behind things like the comments. Something we need to kick around with David....
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums