Slide show caption

Post Reply
AlainB
Posts: 21
Joined: 13 May 20 11:33

Slide show caption

Post by AlainB » 12 Jun 20 18:08

Is there a way to have the rating and color displayed in the Slide show caption ?

Hert
Posts: 6336
Joined: 13 Sep 03 7:24

Re: Slide show caption

Post by Hert » 12 Jun 20 21:24

While I haven’t tried it, you could try to copy the content of this script to the slideshow caption definition

Code: Select all

<font family="tahoma">
<b>%FileName.%FileExtension</b><br/>
<font size="8">%dd %mmm %yyyy</font><br/>
<br/>
%xmp:dc:description
</font>
<br/>Color Label: %xmp:xmp:Label
<br/>%code
    var
      ACatItem: TCatalogItem;
      ARatingAnchorHref: String;
      ARatingNoColor: String;
      ARatingColor: String;
      ARatingStar: String;
      ARatingOnStar: String;
      ARatingOffStar: String;
      i: Integer;
    begin
      result := '';

      ARatingNoColor := '#CFFF0000'; //#### red color 
      ARatingColor   := '#CFFFFF00'; //#### Yellow color for rating stars
      ARatingStar    := 'M 3.03,4.19883 L 2.996,4.22354 L 3.00909,4.26369 L 2.97501,4.2389 L 2.94086,4.26369 L 2.95394,4.22354 L 2.92,4.19883 L 2.96193,4.19883 L 2.97501,4.1589 L 2.98801,4.19883 L 3.03,4.19883 Z ';
      ARatingReject  := 'M 307.583,420.723 C 307.583,425.969 303.331,430.223 298.083,430.223 ' +
                        'C 292.837,430.223 288.583,425.969 288.583,420.723 C 288.583,415.477 ' +
                        '292.837,411.223 298.083,411.223 C 303.331,411.223 307.583,415.477 ' +
                        '307.583,420.723 Z M 302.900,417.541 L 301.486,416.127 L 298.304,419.309 ' +
                        'L 295.121,416.127 L 293.707,417.541 L 296.890,420.724 L 293.707,423.906 ' +
                        'L 295.121,425.320 L 298.303,422.138 L 301.485,425.320 L 302.900,423.906 ' +
                        'L 299.718,420.723 L 302.900,417.541 Z';


      ARatingNoOnStar      := '<img title="no rating" size="18" path="' + ARatingStar + '" pathfillcolor="' + ARatingNoColor + '" pathstrokestyle="solid" pathstrokecolor="' + ARatingNoColor + '">';
      ARatingNoOffStar     := '<img size="18" path="' + ARatingStar + '" pathfillstyle="none" pathstrokestyle="solid" pathstrokecolor="' + ARatingNoColor  + '">';
      ARatingOnStar        := '<img size="18" path="' + ARatingStar + '" pathfillcolor="' + ARatingColor + '" pathstrokestyle="solid" pathstrokecolor="' + ARatingColor + '">';
      ARatingOffStar       := '<img size="18" path="' + ARatingStar + '" pathfillstyle="none" pathstrokestyle="solid" pathstrokecolor="' + ARatingColor + '">';
      ARatingRejectOnStar  := '<img title="reject"   size="18" path="' + ARatingReject + '" pathfillstyle="solid" pathstrokestyle="solid" pathstrokecolor="' + '#CCCCCCCC' + '">';
      ARatingRejectOffStar := '<img title="unreject" size="18" path="' + ARatingReject + '" pathfillstyle="none" pathfillcolor="' + ARatingColor + '" pathstrokestyle="solid" pathstrokecolor="' + ARatingColor + '">';

      ACatItem := TCatalogItem.Create(nil);
      if PublicCatalog.FindImageCombined (ImageItem, ACatItem, False, vptNone) then
      begin
        result := result + '<font color="'+ ARatingColor +'"><ind y="2">';

        {
        if ACatItem.Rating > 0 then
          result := result + StrTran(ARatingNoOnStar, '#rating#', '0')
        else
          result := result + StrTran(ARatingNoOffStar, '#rating#', '0');
        }

        if ACatItem.Rating = -1 then
          result := result + StrTran(ARatingRejectOnStar, '#rating#', '0')
        else
          result := result + StrTran(ARatingRejectOffStar, '#rating#', '-1');

        for i := 1 to ACatItem.Rating do
          result := result + StrTran(ARatingOnStar, '#rating#', iif(ACatItem.Rating = i, '0', IntToStr(i)));
        for i := Max(ACatItem.Rating, 0) + 1 to 5 do
          result := result + StrTran(iif(ACatItem.Rating = -1, ARatingRejectOffStar, ARatingOffStar), '#rating#', IntToStr(i));
        result := result + '</ind></font>';
      end;
      ACatItem.Free;
    end;
    %/code
<br/>
Does that work?

[/edit Hert; copied in the content]
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

AlainB
Posts: 21
Joined: 13 May 20 11:33

Re: Slide show caption

Post by AlainB » 12 Jun 20 22:09

Yes the rating is now included in the caption, but not the color.

Hert
Posts: 6336
Joined: 13 Sep 03 7:24

Re: Slide show caption

Post by Hert » 13 Jun 20 6:06

You can right click in the field for Slide Show Caption. Then select Descriptions - Color Label
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

Hert
Posts: 6336
Joined: 13 Sep 03 7:24

Re: Slide show caption

Post by Hert » 13 Jun 20 10:45

Update; I've copied in the sum of replies to my first response. You can copy/paste that and it includes both the rating bar and the color label
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

Post Reply