Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

How to reduce the subject?

Quote Reply
How to reduce the subject?
Hi,

I'm again Tongue

My question: How I can to reduce the subject in the messaje list so that 25 characters appear only? Only in the messaje list, and not when the messaje is reading.

For example:

Full subject.- Any subject too long to publish it.

Reduced subject in messaje list.- Any subject too long to ...

When the messaje is reading.- Any subject too long to publish it.

Any sugestion??

Thanks again!!
Quote Reply
Re: [RugalMKing] How to reduce the subject? In reply to
Hi RugalMKing,

As a user you can set this by going to Options->Display and set "Maximum subject length displayed on folder list" to 25.

~Charlie
Quote Reply
Re: [Chaz] How to reduce the subject? In reply to
Yes, this is to subject preview, on mouseover, buy I need to reduce the subject in the message list.

I tryed this:

http://www.gossamer-threads.com/...earch_string=subject;

but in the message list the subject is like...

sub { my $vars = shift; (my $subject = $vars->{msgs_subject}) =~ s/^(.{25}).+$/$1 .../; $subject };

Crazy

Can anybody help me?

Thanks!!
Quote Reply
Re: [RugalMKing] How to reduce the subject? In reply to
Maybe I'm not following. You're talking the subject length that displays when you click on home or one of the folders, correct? That's the setting. Here is a screenshot after I set mine to 15

~Charlie
Quote Reply
Re: [Chaz] How to reduce the subject? In reply to
Yes! This is that I want!! My GM version is 2.1.1 and it does not include one option to do it, like to GM 2.2.

It is why I request help.

Thanks! Smile
Quote Reply
Re: [RugalMKing] How to reduce the subject? In reply to
Hi.

You have two options:

(1) Upgrade to latest version keeping a clear view of various "Do's and Dont's of Upgrading"

(2) If for some reason you would not want to upgrade, then try this global (credit afinlr from LSQL Forum):

==>display_truncate

sub {
my $tag = shift;
my $length = shift;
length $tag < $length and return $tag;
my $short = substr ($tag, 0, $length);
$short =~ s/\s\S+?$//;
$short .= " ...";
return $short;
}


Then if you would want to truncate the Subject to 20 call the global in msgs_list_indclude.htm (replacing <%msgs_subject%> with

<%display_truncate($msgs_subject, '20')

Good thig about this is that you can use this to truncate aany other display item also... tried this on my 2.1.0 template set (of which i have a backup from pre-upgrade stage) and it worked....


Anup
Quote Reply
Re: [anup123] How to reduce the subject? In reply to
Excuse me... Blush I'm novice.

Where and/or How I must to use this code??

Thanks!
Quote Reply
Re: [RugalMKing] How to reduce the subject? In reply to
Hi.

Login to your Admin Interface.

Templates(Top Frame)>Globals (on left frame):

Select the Template that you are working with, say nessa (or brewt whichever is your template) from the drop down list.

Then scroll down and in the left hand empt box add some name for the global say:

display_truncate

In the right box by it's side add the code (perhaps taking it thru notepad as direct copy/paste from forum could cause errors) and then hit Save.

Now you have a global by name of display_truncate which can be used in templates. Go to Template From the Templates>Editor Menu and select the template that you are working with (and should be the same name template set where you have saved the above global).

Load the msgs_list_include.htm template and replace <%msgs_subject%> with <%display_truncate($msgs_subject, '20')%> and Save the template. In fact once you decide upon the limit (ie 20 or whatever) then you would need to similar replacements in all other templates wherever <%msgs_subject%> appears.

Hope this helps.

Anup

Last edited by:

anup123: Aug 14, 2004, 3:05 PM
Quote Reply
Re: [anup123] How to reduce the subject? In reply to
Dear friend, thanks for the lesson!! Wink
Quote Reply
Re: [RugalMKing] How to reduce the subject? In reply to
Hi

NP. Did it get what you wanted?

Thanks
Anup
Quote Reply
Re: [anup123] How to reduce the subject? In reply to
Yes, thank you.