Permlink Replies: 5 - Pages: 1 - Last Post: 02-Mar-2018 20:01 Last Post By: jGromit Threads: [ Previous | Next ]
MarkusD

Posts: 484
Registered: 13-Apr-2006
"Tiger|Lightbox|Info panel|Caption template" -> enhancement
Posted: 01-Mar-2018 23:42
  Click to reply to this thread Reply
Hi,

the standard option for Tiger|Lightbox|Info panel|Caption template is:
<h5>${fileLabel}</h5><div class="comment">${comment}</div>

With the tips here in the forum and some research I extend this template to also give information for videos and to show the rating, if any, with the usual stars.

Attached is a screen shot. Here is an example.

I'm not sure if the HTML-Code (regarding the color) for the stars is correct, but it works.

German:
<ja:if exists="originalDate">${originalDate}</ja:if>
<ja:else>${fileDate}<ja:if test="${fileCategory}" value="video"> | FPS: ${videoFPS} - Aufl&ouml;sung: ${videoWidth}x${videoHeight} - Dauer: ${videoDuration}</ja:if></ja:else>
<ja:if exists="fileTitle"> | ${fileTitle}</ja:if>
<ja:switch test="${rating}">
    <ja:case value="0"></ja:case>
    <ja:case value="1"> | <font color="gold">★</font></ja:case>
    <ja:case value="2"> | <font color="gold">★★</font></ja:case>
    <ja:case value="3"> | <font color="gold">★★★</font></ja:case>
    <ja:case value="4"> | <font color="gold">★★★★</font></ja:case>
    <ja:case value="5"> | <font color="gold">★★★★★</font></ja:case>
    <ja:default></ja:default>
</ja:switch>
 | ${comment}</strong>

English:
<ja:if exists="originalDate">${originalDate}</ja:if>
<ja:else>${fileDate}<ja:if test="${fileCategory}" value="video"> | FPS: ${videoFPS} - Resolution: ${videoWidth}x${videoHeight} - Duration: ${videoDuration}</ja:if></ja:else>
<ja:if exists="fileTitle"> | ${fileTitle}</ja:if>
<ja:switch test="${rating}">
    <ja:case value="0"></ja:case>
    <ja:case value="1"> | <font color="gold">★</font></ja:case>
    <ja:case value="2"> | <font color="gold">★★</font></ja:case>
    <ja:case value="3"> | <font color="gold">★★★</font></ja:case>
    <ja:case value="4"> | <font color="gold">★★★★</font></ja:case>
    <ja:case value="5"> | <font color="gold">★★★★★</font></ja:case>
    <ja:default></ja:default>
</ja:switch>
 | ${comment}</strong>
jGromit

Posts: 7,745
Registered: 31-Jan-2006
Re: "Tiger|Lightbox|Info panel|Caption template" -> enhancement
Posted: 01-Mar-2018 23:49   in response to: MarkusD in response to: MarkusD
  Click to reply to this thread Reply
The <font> tag was deprecated in HTML 4.01 and obsoleted in HTML5. It still works in most browsers, but shouldn't be used. I would suggest:
<span style="color:gold;">★</span>
MarkusD

Posts: 484
Registered: 13-Apr-2006
Re: "Tiger|Lightbox|Info panel|Caption template" -> enhancement
Posted: 02-Mar-2018 00:10   in response to: jGromit in response to: jGromit
  Click to reply to this thread Reply
Yes, thanks, that's better.

Instead of the Asterisk sign on the keyboard I use (without the blank after the Ampersand) the black star (https://unicode-table.com/en/2605/)
& #9733;

Attached the code in a text file.
jGromit

Posts: 7,745
Registered: 31-Jan-2006
Re: "Tiger|Lightbox|Info panel|Caption template" -> enhancement
Posted: 02-Mar-2018 00:24   in response to: MarkusD in response to: MarkusD
  Click to reply to this thread Reply
For clarity, maybe use the HTML entity for the same thing:
&starf; or &bigstar;
MarkusD

Posts: 484
Registered: 13-Apr-2006
Re: "Tiger|Lightbox|Info panel|Caption template" -> enhancement
Posted: 02-Mar-2018 19:25   in response to: jGromit in response to: jGromit
  Click to reply to this thread Reply
Thanks. That's even better, using some memorable descriptions instead of just a number code.
jGromit

Posts: 7,745
Registered: 31-Jan-2006
Re: "Tiger|Lightbox|Info panel|Caption template" -> enhancement
Posted: 02-Mar-2018 20:01   in response to: MarkusD in response to: MarkusD
  Click to reply to this thread Reply
Yeah, they're identical, but the code is less mysterious. :)
Legend
Forum admins
Helpful Answer
Correct Answer

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