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


Permlink Replies: 4 - Pages: 1 - Last Post: 16 Dec 22, 21:48 Last Post By: ctwist
ctwist

Posts: 471
Registered: 27-Sep-2003
Chained navigation bypasses weblocs
Posted: 25 Nov 22, 00:42
 
  Click to reply to this thread Reply
If an album uses "full tree chaining" (I haven't tested siblings), "next" and "previous" buttons on slide pages bypass weblocs (e.g. a YouTube video).

Is this intentional behaviour? Does jAlbum assume that a webloc does not require a slide page?
  • If true, can I override it (e.g. by the skin setting a user variable)?
  • If not, can this be changed so that it does navigate to webloc slide pages?
RobM

Posts: 3,718
Registered: 4-Aug-2006
Re: Chained navigation bypasses weblocs
Posted: 25 Nov 22, 10:51   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
Have you set the skin property MAKE_WEB_LOCATION_SLIDES .

Edited by: RobM on 25 Nov 2022, 10:20
Default is to make slide pages, so it should not be set to false. If the property has not been set at all does setting it to true work
ctwist

Posts: 471
Registered: 27-Sep-2003
Re: Chained navigation bypasses weblocs
Posted: 25 Nov 22, 16:38   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
That skin property is not set. If I add the property, it does not change the behaviour.

However, I have identified the circumstances that cause the problem.

Set chaining to "Full tree".

1) set the order to:
jpg1 -> jpg2 -> webloc -> subfolder
The "next" buttons navigate in the sequence:
jpg1 -> jpg2 -> first jpg in subfolder

2) set the order to:
jpg1 -> webloc -> jpg2 -> subfolder
The "next" buttons navigate in the sequence:
jpg1 -> webloc -> jpg2 -> first jpg in subfolder

So, this is a bug.
JeffTucker

Posts: 7,738
Registered: 31-Jan-2006
Re: Chained navigation bypasses weblocs
Posted: 16 Dec 22, 21:01   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
It appears to be a semi-bug. The next/previous sequence does seem to ignore weblocs. But slide pages are produced for them if the skin.properties value is set to true.

I'd be very careful about demanding that this be fixed. I don't think any of the current "slide page" skins make use of it - they're specifically set not to produce slide pages for weblocs.

Why? To me, a webloc is a thumbnail that leads directly to an external site. I'm not sure what a slide page for a webloc should do. Is the purpose of the slide page to showcase the representing image? Should clicking on the image navigate to neighboring slides? Or should clicking it, like clicking on the thumbnail, take the visitor to the external site, thereby exiting from the gallery?

I wouldn't want to see a "fix" for this bug louse up the behavior that skins are currently expecting. Let sleeping bugs lie. ;)

FWIW, I wouldn't use webloc's for YouTube videos.
ctwist

Posts: 471
Registered: 27-Sep-2003
Re: Chained navigation bypasses weblocs
Posted: 16 Dec 22, 21:48   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Actually, I wrote this method today. I am going off on a tangent slightly, but anyway here it is.

If your skin contains types of album objects that should be ignored when clicking "next" or "previous" in a chained album, this bypasses them.
	// Get the relative path to the next or previous slide page (could be in a different folder if chaining).
	private String getNextSlide(String pDirection)  // P - previous, N - next
	{ Map<String, Object> vCalcVars = (Map<String, Object>)current.get(pDirection.equals("P") ? "previous" : "next");  // All variables for the current iterating object
		String vPageNext = (String)(pDirection.equals("P") ? previousPage : nextPage);
		String vSlidePath = vPageNext;  // Relative path from the current slide page to the next or previous slide page.
		// Loop through the slides until one is found that should be shown (usually the first one)
		while (true)
		{ if (vPageNext == null)  // Reached the beginning or end of the folder
			{ vSlidePath = null;
				break;
			}
 			if (<< ADD YOUR CODE HERE TO DECIDE IF THIS SLIDE SHOULD BE SKIPPED >>)  // This slide must be skipped
			{ vPageNext = (String)vCalcVars.get(pDirection.equals("P") ? "previousPage" : "nextPage");
				vSlidePath = FilenameUtils.getFullPath(vSlidePath) + vPageNext;  // https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FilenameUtils.html
				vCalcVars = (Map<String, Object>)vCalcVars.get(pDirection.equals("P") ? "previous" : "next");
				continue;
			}
    	break;
		}
		// Normalise the path (not necessary, but removes clutter from the path)
    if (vSlidePath != null)
		{ vSlidePath = vSlidePath.replace("/" + engine.getSlideDirectory() + "/..", "");
			if (vSlidePath.startsWith("../" + engine.getSlideDirectory() + "/"))
			{ vSlidePath = vSlidePath.substring(4 + engine.getSlideDirectory().length());
			}
		}
		return vSlidePath;
	}
Legend
Forum admins
Helpful Answer
Correct Answer

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