This question is answered.


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

Posts: 11
Registered: 21-Jul-2025
Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 11:36
 
  Click to reply to this thread Reply
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 :)
RobM

Posts: 3,936
Registered: 4-Aug-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 12:10   in response to: Skwide in response to: Skwide
Helpful
  Click to reply to this thread Reply
Try looking at some of the bundled skins, like Tiger. The caption/comment has preset templates, see https://jalbum.net/help/en/Skin/Tiger3/Sections/Images

Note the link to variables that can be used, those variables include many camera metadata.

Responsive skin’s developer is no longer around, so support for editing the skin may not be forthcoming. It would require someone to look into the code and try to figure out how it works in specific areas.
Skwide

Posts: 11
Registered: 21-Jul-2025
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 14:40   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I see - thank you.

I'll have a look at Tiger.
I was expecting some sort of HTML template, but the photo page in Responsive seemed to be code with no clear definitin of the Caption text...
RobM

Posts: 3,936
Registered: 4-Aug-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 16:05   in response to: Skwide in response to: Skwide
Helpful
  Click to reply to this thread Reply
Skwide wrote:
I see - thank you.

I'll have a look at Tiger.
I was expecting some sort of HTML template, but the photo page in Responsive seemed to be code with no clear definition of the Caption text...

Responsive skin is designed more around JavaScript than HTML and CSS. Being JavaScript based it allows for the output to be embedded in other webpages. You can read about the design ideas of the skin at https://jalbum.net/help/en/Single_page_web_album
JeffTucker

Posts: 8,050
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 17:44   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
Skwide wrote:
I was expecting some sort of HTML template, but the photo page in Responsive seemed to be code with no clear definitin of the Caption text...

First, some remarks about the two types of jAlbum skins.

Once upon a time, almost all skins were based on HTML/CSS templates, which generate the finished pages on your PC, and then just feed them to a browser. But today, most of the bundled skins are JSON-based. The pages are generated "on the fly," in the browser, using the information in the JSON database files. These are primarily Javascript.

Most of Laza's skins are now JSON-based. Most of mine, on the other hand, use HTML/CSS templates, with JS being used to provide some fancier functionality in the finished page.

Modifying either type of skin to do something it's not designed to do would be a tall order. With the JS skins, doing that kind of tweaking would be exceedingly difficult, if it could be done at all. But even in my HTML/CSS skins, there are all sorts of hidden traps that would make it very tough to change something like the caption contents without breaking other things. There are just too many pieces to the puzzle to keep track of.

Continued in next post....
JeffTucker

Posts: 8,050
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 17:51   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
So, what does that leave you with? Well, some skins provide a way to include various metadata in the caption. Tiger is an example of this. Offhand, I can't recall how to embed metadata in one of its custom caption templates, but I'll poke around and try to refresh my memory.

In my skins, I almost always include the ability to display whatever metadata you like as part of the slide caption. Here's a quick example, using Neptune:

(Demo album removed.)

In this case, I'm using just standard EXIF metadata, but the skin lets you use any metadata field. And you have complete control over the display of that metadata - labels/no labels, fonts, etc.

Edited by: JeffTucker on 5 Aug 2025, 09:07
Skwide

Posts: 11
Registered: 21-Jul-2025
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 18:07   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Thank you - I naively assumed that "templating the text below the photo" would be a sort of a central standard thing that would work uniformly.

I will look at your skins - thank you ever so much.
JeffTucker

Posts: 8,050
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 18:07   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
Tiger is an example of this. Offhand, I can't recall how to embed metadata in one of its custom caption templates, but I'll poke around and try to refresh my memory.

Here's what I was trying to remember:

https://jalbum.net/forum/thread.jspa?messageID=367939&#367939

And a quickly slapped-together example:

https://jefftucker.jalbum.net/metacaptionTiger/
Skwide

Posts: 11
Registered: 21-Jul-2025
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 18:09   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Thanks very much :)

Edited by: Skwide on 22 Jul 2025, 18:12
JeffTucker

Posts: 8,050
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 18:12   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
Skwide wrote:
Thank you - I naively assumed that "templating the text below the photo" would be a sort of a central standard thing that would work uniformly.

Well, yes and no. Skin developers do their own thing, but they tend to be internally consistent. Laza's skins usually include the same "custom caption" routine, across many of the skins. My skins usually include the same metadata display routines - install one of them, like Neptune, and take a quick look at the Metadata tab in the skin's settings. You'll find pretty much the same thing in my other skins. But Laza and I take totally different approaches to skin design, so there's not much commonality between his skins and mine.

BTW, the demo site of my skins: https://jefftucker.jalbum.net/skins/
JeffTucker

Posts: 8,050
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 18:19   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Here are a couple of screenshots that you might find helpful, of the skin settings used to produce the metadata display in each skin.

Laza could probably refine my clumsy Tiger settings, but you can at least see how it's done.

The Neptune settings are more obvious, and from the screenshot, you can see that it supports any metadata field, you can provide whatever labels you want, and you can click and drag the entries into whatever display order you want.
MarkusD

Posts: 742
Registered: 13-Apr-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 18:38   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
If you are looking for a more complex code. Here we go:
<ja:if exists="originalDate"><i>${originalDate}</i></ja:if>
<ja:else>
<i>${fileDate}</i>
 <ja:if test="${fileCategory}" value="video"> | <i>FPS: ${videoFPS} - Auflösung: ${videoWidth}×${videoHeight} - Dauer: ${videoDuration}</i></ja:if>
</ja:else>
<ja:if exists="gpsLocation">
 | <a href="https://maps.google.com/?q=${gpsLocation}" class="mylink" rel="noreferrer nofollow"><abbr title="Google"><i class="fa fa-map-marker"> </i></abbr></a>
</ja:if>
<ja:if exists="gpsLocation">
 | <%= (gpsLocation? '<a href="https://www.openstreetmap.org/?mlat=' + gpsLocation.split(',')[0] + '&mlon=' + gpsLocation.split(',')[1] + '&zoom=16#map=' + gpsLocation.split(',')[0] + '/' + gpsLocation.split(',')[1] + '" class="mylink" rel="noreferrer nofollow"><abbr title="OSM"><i class="fa fa-map-marker"> </i></abbr></a>' : '') %>
</ja:if>
<ja:if exists="gpsLocation">
 | <%= (gpsLocation? '<a href="https://kart.finn.no/?lng=' + gpsLocation.split(',')[1] + '&lat=' + gpsLocation.split(',')[0] + '" class="mylink" rel="noreferrer nofollow"><abbr title="kart.finn.no"><i class="fa fa-map-marker"> </i></abbr></a>' : '') %>
</ja:if>
<ja:if exists="gpsLocation">
 | <a href="https://www.windy.com/?${gpsLocation},16" class="mylink" rel="noreferrer nofollow"><abbr title="windy.com"><i class="fa fa-map-marker"> </i></abbr></a>
</ja:if>
<ja:if exists="meta">
 <ja:if test="<%=meta.get("Gps.GPS Altitude") != null && !meta.get("Gps.GPS Altitude").equals("") %>"> | <i>Höhe: ${gpsAltitude}</i></ja:if>
 <ja:if test="<%=meta.get("Iptc.Country/Primary Location Name") != null %>"> | <i>Land: <%=meta.get("Iptc.Country/Primary Location Name")%></i></ja:if>
 <ja:if test="<%=meta.get("Iptc.City") != null %>"> | <i>Stadt: <%=meta.get("Iptc.City")%></i></ja:if>
 <ja:if test="<%=meta.get("Iptc.Province/State") != null %>"> | <i>Bundesland: <%=meta.get("Iptc.Province/State")%></i></ja:if>
 <ja:if test="<%=meta.get("Iptc.Sub-location") != null %>"> | <i>Ortsdetail: <%=meta.get("Iptc.Sub-location")%></i></ja:if>
</ja:if>
<ja:switch test="${rating}">
 <ja:case value="1"> | <span style="color:gold;">&starf;</span></ja:case>
 <ja:case value="2"> | <span style="color:gold;">&starf;&starf;</span></ja:case>
 <ja:case value="3"> | <span style="color:gold;">&starf;&starf;&starf;</span></ja:case>
 <ja:case value="4"> | <span style="color:gold;">&starf;&starf;&starf;&starf;</span></ja:case>
 <ja:case value="5"> | <span style="color:gold;">&starf;&starf;&starf;&starf;&starf;</span></ja:case>
 <ja:default></ja:default>
</ja:switch>
<ja:if exists="fileTitle"> | ${fileTitle}</ja:if>
 | ${comment}


How it looks in an album:
https://www.markus-drueck.de/norge/2024%2001%2027%20Norge/2024%2002%2003%20Longyearbyen/index.html#img=IMG_7206.JPG

Cheers, Markus
Skwide

Posts: 11
Registered: 21-Jul-2025
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 20:18   in response to: Skwide in response to: Skwide
 
  Click to reply to this thread Reply
I bought myself a one month subscription so I could unlock and actually test stuff.

Can I ask: (In Tiger skin) - is there a list of defined variables?

eg in this Lightbox/Caption template, originalTime works, but not originalDate (my guess to get the date field).

Google is not being particularly helpful...

${originalTime} - ${originalDate}
Title: ${fileTitle}
Comment: ${comment}
JeffTucker

Posts: 8,050
Registered: 31-Jan-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 20:49   in response to: Skwide in response to: Skwide
Correct
  Click to reply to this thread Reply
To figure out the actual name of the metadata fields, right-click on one of the thumbnails in your project (in the jAlbum Explore view), then choose Extensions > List metadata. That will reveal the field names that are present in your images. Just copy, verbatim, the field name you want, up to the "equals" sign.

The purely jAlbum variables are listed here:

https://jalbum.net/help/en/Variables

A skin like Tiger may also create its own variables, but those are generally not documented anywhere.
MarkusD

Posts: 742
Registered: 13-Apr-2006
Re: Changing the text template for the individual photo page? (Newbie Q)
Posted: 22 Jul 25, 22:27   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).
Have you seen my code (above)?
Legend
Forum admins
Helpful Answer
Correct Answer

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