Shorten Names of Images When Looking at Thumbnails
|
LBSources
Joined: 2007-07-12
Posts: 24 |
Posted: Fri, 2008-08-29 14:50
|
|
Hi.. After looking at this old threadI'm wondering if this is now just supported in Gallery .. If so, where is the setting? If it's not and still requires a hack to achieve, where do I get started? Thanks in advanced. LBS |
|
| Login or register to post comments |

Posts: 11717
That thread is for G1.. G2 is completely different so it can be fixed easy in G2. What theme are you using and are you wanting to shorten the title or the description. Some themes have both some don't.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 24
Hi Foridave .. Ah sorry on the version confusion.. I'm using the Matrix theme.. Do you know which themes support the "fix"? I want to either get rid of or shorten the actual name of the picture when viewing it in thumbnail view.
Thanks!
Posts: 11717
Edit galery2/themes/matrix/templates/album.tpl
find
{if !empty($child.title)} <p class="giTitle"> {if $child.canContainChildren && (!isset($theme.params.albumFrame) || $theme.params.albumFrame == $theme.params.itemFrame)} {* Add prefix for albums unless imageframe will differentiate *} {g->text text="Album: %s" arg1=$child.title|markup} {else} {$child.title|markup} {/if} </p> {/if}And remove.
Or if you want to truncate it then you will have to use the truncate modifier.
http://www.smarty.net/manual/en/language.modifier.truncate.php
on
$child.title|markupDave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 24
Hey Floridave the truncate worked, but it removes them from the albums also when looking at them as thumbnails (before actually entering a album). I actually just wanted to remove the names or truncate (now that I can) them from the images when looking at them in thumbnail mode.
Any chance or to much to ask for..
Posts: 11717
I don't understand,
You want the titles of the thumbs to be truncated but not the title of the albums?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 24
so when you first hit any gallery page you see all the albums as thumbnails right? The names are under the highlight image. You click into an album and there you have all the pictures as thumbnails. I want to remove the image names from the image thumbnails, but not the album thumbnails. Is it possible?
Posts: 11717
The bit of code I quoted will do that, just truncate the title after the {else} the first title is for the album(s)
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 24
Ok.. Here is what I have, but the album names when in thumbnail view are also truncated which I dont want..
{if !empty($child.title)} <p class="giTitle"> {if $child.canContainChildren && (!isset($theme.params.albumFrame) || $theme.params.albumFrame == $theme.params.itemFrame)} {* Add prefix for albums unless imageframe will differentiate *} {g->text text="Album: %s" arg1=$child.title|markup} {else} {$child.title|markup|truncate:20} {/if} </p> {/if}Posts: 11717
must be a cache issue.
URL?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 24
URL sent to you
Posts: 11717
I did not know if you were using album frames or not. See how much URLs help! So this is the code then:
from
{else} {$child.title|markup|truncate:20} {/if} </p> {/if}to
{else} {if $child.canContainChildren}{$child.title|markup}{else}{$child.title|markup|truncate:20}{/if} {/if} </p> {/if}Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 24
Hmmm that seemed to create just a blank page
Posts: 11717
Works for me, if you get a blank page then you probably missed a closing curly brace or some other typing error. Does your editor add stuff to the bottom or other such things?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 24
There we go .. You might have been right... I'm sorted out now.. Dave thank you very much!