Gossamer Forum
Home : Products : Gossamer Links : Discussions :

how convert br tags?

Quote Reply
how convert br tags?
HiWink

I have seen that in setup/Review Options, we have the convert_br_tags option

I would like the same option for the description field of my links. Is it possible? how to do it?


ThanksWink

FMP

Last edited by:

fmp: Mar 16, 2002, 3:32 AM
Quote Reply
Re: [fmp] how convert br tags? In reply to
Yikes, the URL in your post leads straight to your unprotected admin page.

I hope you don't mind but I password protected it for you. I need to tell you the usename/password but I don't have a way of contacting you.

Last edited by:

Paul: Mar 16, 2002, 3:16 AM
Quote Reply
Re: [Paul] how convert br tags? In reply to
thanks paul...

I made a big mistake in putting that link...;)

do you have the solution to convert the <br> tags in the description fied?



txs
Quote Reply
Re: [fmp] how convert br tags? In reply to
You'd need a global....

What do you want to substitute the br's with?

sub {
my $tags = shift;
$tags->{Description} =~ s/<br>/some_value/sg;
return $tags;
}

Last edited by:

Paul: Mar 16, 2002, 3:39 AM
Quote Reply
Re: [Paul] how convert br tags? In reply to
thanks for the answer..

maybe my question was not very well asked...

when a user types in the descirption field without html and when he wants to have a line break, he just types [enter] twice.

But after I have build the links, there is no line break...so it is not very easy to read (especialy when the description is very long).

All I want is to see the line breaks he has done when he did fill the description field


Thanks

FMPWink
Quote Reply
Re: [fmp] how convert br tags? In reply to
Ah, you'd need something like this:

sub {
my $tags = shift;
$tags->{Description} =~ s/\n/<br>/sg;
return $tags;
}

....or you can create a new tag and use that instead like:

sub {
my $tags = shift;
$tags->{neat_description} =~ s/\n/<br>/sg;
return $tags;
}

Last edited by:

Paul: Mar 16, 2002, 5:10 AM
Quote Reply
Re: [Paul] how convert br tags? In reply to
Thanks it works greatWink....

I did use

sub {
my $tags = shift;
my $Description = $tags->{Description};
$Description =~ s/\n/<BR>\n/g;
return $Description;
}

Last question, I would like the first letter of the description to be replaced with an nice image letter gif.

An exemple of what I want to do (on a cold fusion website) : http://www.agetresorerie.com/...s/lire.cfm?idxdos=39

Is it the same kind of global I used to get the line breaks? Is it possible to have only one global making all the stuff : (to get the line breaks and to replace the first letter)?

thanks again...

FMP
Quote Reply
Re: [fmp] how convert br tags? In reply to
Try adding....

$Description =~ s,^([a-z]),<img src="/images/\L$1.gif">,i;

...just before:

return $Description;

...then name your images a.gif b.gif etc.
Quote Reply
Re: [fmp] how convert br tags? In reply to
For more details on this, see:

http://www.gossamer-threads.com/...s/Detailed/1830.html

which has a link to a detailed thread in the forum about this.

Cheers,

Alex
--
Gossamer Threads Inc.