How to Truncate the Description under Thumbnails How to Truncate the Description under Thumbnails
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

How to Truncate the Description under Thumbnails

Started by Chopper, March 17, 2005, 08:21:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chopper

I would like to truncate the long descriptions that appear under the thumbnails in the albums. The longer descriptions are screwing up the layout of the page.

You can see an example here:

http://www.animationcorner.com/studio/thumbnails.php?album=1

As you can see, the longer descriptions push the next row of thumbnails down. I would prefer not to have to shorten the description length in the Coppermine config screen, because it's nice allowing the members to write paragraph descriptions below their artwork.

So is there anyone that knows which piece of code to change to truncate the description below those thumbnails to just 5 words or so? Maybe make it so that the description ends with 3 dots ... and then the user can click the thumbnail and read the entire description when the full image page loads.

Any help is appreciated, thanks.

Tranz

One way is to use PHP to truncate the text. The other way is to use CSS to use scrollbars: http://forum.coppermine-gallery.net/index.php?topic=550.0

Chopper

#2
What if I just wanted to remove the descriptions completely from below the thumbnails. Do you know which file and what section of code I would need to go to, to do this?

BTW...if I were to look up on how to truncate in PHP, what PHP function would I do a search on Google for?

Chopper

Never mind, I found this section of code in the theme.php and deleted the {CAPTION} tag.

<!-- BEGIN thumb_cell -->
        <td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
                <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td align="center">
                                        <a href="{LINK_TGT}">{THUMB}<br /></a>
                                        {CAPTION}
                                        {ADMIN_MENU}
                                </td>
                        </tr>
                </table>
        </td>
<!-- END thumb_cell -->

Tranz

Thank you for coming back and posting the solution.

Chopper

Actually, deleting the {CAPTION} tag removed all the information from all the thumbnails in every listing. So I added it back.

I later discovered that there is this option in the Coppermine Configuration screen under the "Thumbnail View" options:

Display file caption (in addition to title) below the thumbnail. (Yes or No)

This was exactly what I was looking for. Sometimes I make a simple problem into more than it is. It was already available for me to adjust through the Coppermine interface. :)