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