What are you really trying to do? Why move your original code and why can’t you move it back?
With an album with 100 folders, that part of code was 101 times loaded because it was in index.html.
With the new template all 101 index.html files are smaller, so the whole album takes less space and loads faster.
But if a single image has ‘use original’ or ‘include original’ set how do you know which one to apply the download to on the index page?
Regardless, you could in index.htt use
<%!
boolean orgImages = false;
CheckOriginals(AlbumObject folder, boolean hasOriginal) {
for(ao: folder.getChildren()) {
if(ao.isFolder()) hasOriginal = CheckOriginals(ao, hasOriginal);
else {
your code to check for original path with
if original exists set hasOriginal to true
}
}
orgImages = checkOiginals(rootFolder, false);
%>
Not tested.
Edited by: RobM on 8 Apr 2022, 18:34
added the assignment of the result of the recursive call