Gossamer Forum
Home : Products : Gossamer Links : Discussions :

CR/LF to <BR> Formatting Text fields

Quote Reply
CR/LF to <BR> Formatting Text fields
Where would I make a change and/or how would I make a change to make the text that a user enters in a textarea format with line breaks <BR> when the pages are built?

In other words. If the user enters:

My
Green
Apple

in a text field, have the page build that way instead of :

MyGreenApple

I saw something about this for another program, but haven't found it for Links SQL 2.0 . If it's here all my searched failed to find it. :(

Quote Reply
Re: CR/LF to <BR> Formatting Text fields In reply to
Hi,

Easiest way would be to add a global called Description_Formatted that looks like:

Code:
sub {
my $tags = shift;
my $description = $tags->{Description};
$description =~ s/\n/<BR>\n/g;
return $description;
}
and then in your template use <%Description_Formatted%>.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: CR/LF to <BR> Formatting Text fields In reply to
Zipity Do Dah!! That worked!! and it was easy and quick!
I am more impressed with this new release all the time.!
Great job guys!!