Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [Reena0330] dbman -> dbman sql (paragraph indenting)

Quote Reply
Re: [Reena0330] dbman -> dbman sql (paragraph indenting) In reply to
Reena,
I found the answer to my problems - and perhaps yours - in the plugin/globals section of the Links SQL forum (search for 'BR tags in admin submissions')

My original TEXT field is called 'Content'.
I created a global called 'Content_Formatted'

sub {
my $tags = shift;
my $content = $tags->{Content};
$content = GT::CGI::html_escape ($content);
$content =~ s/\n/<BR>\n/g;
return $content;
}

Then I included a field/column which I called TextFormat (ENUM, values: PlainText, HTML) with radio buttons. So when I add each record I select what kind of text I'm including.[:)]

Last step, in my template, I have simply:

<%if TextFormat eq 'PlainText'%>
<%Content_Formatted%>
<%else%>
<%Content%>
<%endif%>

This works fine - all thanks to the fora contributions, notably Alex!
BTW: it's worth browsing through the Links SQL fora, because there seems to be a lot of things useful to DBMan SQL users. - much more than in the DBMan SQL fora [:/]
Cheers
Charly
Subject Author Views Date
Thread dbman -> dbman sql (paragraph indenting) Reena0330 3651 Jun 10, 2002, 1:13 PM
Thread Re: [Reena0330] dbman -> dbman sql (paragraph indenting)
charly 3578 Jun 10, 2002, 1:46 PM
Thread Re: [charly] dbman -> dbman sql (paragraph indenting)
Reena0330 3579 Jun 10, 2002, 1:57 PM
Thread Re: [Reena0330] dbman -> dbman sql (paragraph indenting)
charly 3561 Jun 12, 2002, 9:05 AM
Thread Re: [charly] dbman -> dbman sql (paragraph indenting)
charly 3573 Jun 15, 2002, 1:44 PM
Post Re: [charly] dbman -> dbman sql (paragraph indenting)
Reena0330 3531 Jun 21, 2002, 4:01 PM
Thread Re: [charly] dbman -> dbman sql (paragraph indenting)
Reena0330 3518 Jun 27, 2002, 5:14 PM
Post Re: [Reena0330] dbman -> dbman sql (paragraph indenting)
charly 3499 Jun 28, 2002, 2:26 AM
Post Re: [Reena0330] dbman -> dbman sql (paragraph indenting)
YoYoYoYo 3166 Feb 12, 2003, 7:10 AM