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
floridave
floridave's picture

Joined: 2003-12-22
Posts: 11717
Posted: Fri, 2008-08-29 20:46

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

Login or register to post comments
LBSources

Joined: 2007-07-12
Posts: 24
Posted: Fri, 2008-08-29 23: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!

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 11717
Posted: Sat, 2008-08-30 04:42

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|markup

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
LBSources

Joined: 2007-07-12
Posts: 24
Posted: Sat, 2008-08-30 12:21

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..

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 11717
Posted: Sat, 2008-08-30 14:53

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

Login or register to post comments
LBSources

Joined: 2007-07-12
Posts: 24
Posted: Sat, 2008-08-30 17:41

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?

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 11717
Posted: Sun, 2008-08-31 00:25

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

Login or register to post comments
LBSources

Joined: 2007-07-12
Posts: 24
Posted: Mon, 2008-09-01 12:11

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}

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 11717
Posted: Tue, 2008-09-02 03:33

must be a cache issue.
URL?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
LBSources

Joined: 2007-07-12
Posts: 24
Posted: Tue, 2008-09-02 10:55

URL sent to you :)

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 11717
Posted: Tue, 2008-09-02 22:54

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

Login or register to post comments
LBSources

Joined: 2007-07-12
Posts: 24
Posted: Wed, 2008-09-03 09:48

Hmmm that seemed to create just a blank page :(

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 11717
Posted: Wed, 2008-09-03 14:14

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

Login or register to post comments
LBSources

Joined: 2007-07-12
Posts: 24
Posted: Wed, 2008-09-03 23:10

There we go .. You might have been right... I'm sorted out now.. Dave thank you very much!

Login or register to post comments