coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: Chopper on March 17, 2005, 08:21:01 PM

Title: How to Truncate the Description under Thumbnails
Post by: Chopper on March 17, 2005, 08:21:01 PM
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.
Title: Re: How to Truncate the Description under Thumbnails
Post by: Tranz on March 17, 2005, 08:34:48 PM
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
Title: Re: How to Truncate the Description under Thumbnails
Post by: Chopper on March 17, 2005, 08:51:37 PM
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?
Title: Re: How to Truncate the Description under Thumbnails
Post by: Chopper on March 17, 2005, 09:06:52 PM
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 -->
Title: Re: How to Truncate the Description under Thumbnails
Post by: Tranz on March 17, 2005, 09:25:38 PM
Thank you for coming back and posting the solution.
Title: Re: How to Truncate the Description under Thumbnails
Post by: Chopper on March 18, 2005, 12:00:20 AM
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. :)