This question is answered.


Permlink Replies: 23 - Pages: 2 [ Previous | 1 2 ] - Last Post: 5 Aug 25, 15:08 Last Post By: RobM Threads: [ Previous | Next ]
JeffTucker

Posts: 8,099
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 23:00   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
Skwide wrote:
eg in this Lightbox/Caption template, originalTime works, but not originalDate (my guess to get the date field).

Just did a quick test, and ${originalDate} works properly.

This is where things can get a bit confusing. If you feed ${meta.Date/Time} to the caption template, it will pick up the contents of that metadata field in the image. But jAlbum also extracts some of the metadata, does some formatting on it, and makes is available with its own variable names. So, ${originalDate} is usually the better choice. But don't try ${meta.originalDate}, because that's not the name of the actual, image-embedded metadata field.

Also remember that all variable calls in jAlbum must be in curly braces, not parentheses. That one still catches me from time to time. ;)
Skwide

Posts: 11
Registered: 21-Jul-2025
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 23 Jul 25, 00:40   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
Blanket reply -
Thanks everyone. I'm starting to get it.

The extentions/list metadata solved a lot of problems - I found all the location data that Lightroom had inferred from the GPS data (city/state/country which is nice to display).

Currently trying Neptune skin and have managed to make these custom fields which works nicely.

I will also go and try Tiger again and try these as template variables.

I have to admit, it's maybe not as intuitive as I was expecting - however, with the LR plugin, it seems to be pretrty smart about generating static album sites which is exactly what I was after - a simple way to host the extensive family photo album for 20+ years on webserver internal to our home network, so I don;t have to worry about exposing private photos to the world by mistake.

Cheers :)
JeffTucker

Posts: 8,099
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 23 Jul 25, 00:52   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
Post back if you get stumped on something. :)

My skins, at least, have full user's manuals - from any of the skin settings panels, click the "?" icon at upper right to pull up the manual page for that panel.
Skwide

Posts: 11
Registered: 21-Jul-2025
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 23 Jul 25, 01:10   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Hi Markus -

Thansk for that code. I tried it and it works (some of my fields are missing, but I like the rating and it does a nice job on the data/time - which I will steal :)

This looks like some sort of templating language...

What is it - something well known? I don't code java, mostly python these days, so I'm not familiar with all the java libraries...
JeffTucker

Posts: 8,099
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 23 Jul 25, 01:17   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
Skwide wrote:
This looks like some sort of templating language...

What is it - something well known?


That's jAlbum's own scripting language. Has its roots in Java, but is unique to this app.

https://jalbum.net/help/en/Tags
MarkusD

Posts: 761
Registered: 13-Apr-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 23 Jul 25, 20:28   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
Skwide wrote:
Hi Markus -

Thansk for that code. I tried it and it works (some of my fields are missing, but I like the rating and it does a nice job on the data/time - which I will steal :)

You are welcome. :-)

The thing is, that most of the code based on answers I got here in the forum. :-) So the credit goes to the usual suspects, Jeff, Rob, David, Laza.

Cheers, Markus
RobM

Posts: 3,950
Registered: 4-Aug-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 23 Jul 25, 22:49   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
Skwide wrote:
Hi,

Can anyone give me a head start please - I'd like to change the text on the main photo page (Responsive skin, but could be any other) to:

Line 1 - Caption as is now;
Line 2 - Combination of Capture date, time, location (City, Region, Country). Maybe camera.

I have all this data in the image meta data from Lightroom Classic (using the jAlbum plugin to publish to jAlbum).

My research led me to making a new skin based off the Responsive skin, then I got lost trying to find where the main photo page template was... Not even sure if editing the skin is the right way or not.

Any pointers to get started would be veru welcome - thank you :)

Going back to the original question: Responsive skin.
The code that generates the content, like the comment is within the skin folder>res>js>main.js file. To add more to the line with the description you first need to look at the file data1.json generated in the album's root folder. Open it in a text editor to see the contents. Search for the data you want to add, like original date and see where it appears in the structure of the json file. An example of part of the file, with fileDate and originalDate is
{"path":"jakob-owens.jpg","image":{"path":"slides\/jakob-owens.jpg","width":1536,"height":995},"thumb":{"path":"thumbs\/jakob-owens.jpg","width":256,"height":166},"fileSize":239719,"name":"jakob-owens.jpg","rating":1,"comment":"Photo by <a href=\"https:\/\/unsplash.com\/@jakobowens1?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText\">Jakob Owens<\/a> on <a href=\"https:\/\/unsplash.com\/s\/photos\/photographer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText\">Unsplash<\/a>","fileDate":"2024-06-17T11:26:05.0Z","category":"image","title":"I See You!","camera":{"originalDate":"2024-06-17T11:26:05.0Z"}},


To add more data than supplied you need to modify main.js in two places. First is the block that includes data from the data!.json file, it starts at line 337.
slides[imageIndex] = {
That block includes the description but not the original date, so you need to add it and the fallback file date.
originalDate: object.camera.originalDate,
 fileDate: object.fileDate
};

Next you need to change the code that injects the content into the webpage. Jump to line 811 which looks like this
if(slides[index].description != undefined){
This block needs changing to test if the new variables, originalDate and fileDate exist or not, but for now lets look at how to add those variables. originalDate is in the form
slides[index].originalDate
and fileDate is
slides[index].fileDate

You can try it by changing the description line like this
description.append("<p>" +  slides[index].fileDate + " " + slides[index].description + "</p>");


Then you need to re-arrange the block of code so that you test for originalDate not being undefined and if it is fall back to the fileDate variable.

The above is just to show how complicated it is to make adjustments to such a skin - I had to play with it a bit to find the code blocks and get the correct json structure. Using another skin is much easier!
JeffTucker

Posts: 8,099
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 23 Jul 25, 23:01   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
The above is just to show how complicated it is to make adjustments to such a skin....

Makes all the blood drain from my head, so I feel woozy and have to lie down for a bit.
RobM

Posts: 3,950
Registered: 4-Aug-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 23 Jul 25, 23:25   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
RobM wrote:
The above is just to show how complicated it is to make adjustments to such a skin....

Makes all the blood drain from my head, so I feel woozy and have to lie down for a bit.

Curiosity got the better of me, I think I remembered a bit from when the skin first appeared and I read the single page website page back then. But I'm too old to learn old tricks (again).
Legend
Forum admins
Helpful Answer
Correct Answer

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