This is the CF_ParagraphFormat tag I wrote cause I hated the way
ParagraphFormat() outputs code.

Basically you get the user to enter their text in a TEXTAREA, save it as a
memo field and then wrap CF_ParagraphFormat around the variable. It finds
double carriage return/line feeds, formats them with P tags with whatever
style info you supplied and reformats single carriage return/line feeds with
BRs.


Usage
=======================
<CF_ParagraphFormat Style="font-size: 11pt; font-weight: bold;
">#YourMemoFieldHere#</CF_ParagraphFormat>


CF_ParagraphFormat
=======================
<CFPARAM NAME="attributes.Style" DEFAULT="">

<CFSET variables.Style="">

<CFIF Len(attributes.Style)>
   <CFSET variables.Style = " STYLE=""" & attributes.Style & """">
</CFIF>

<CFIF ThisTag.ExecutionMode is "end">
   <CFSET ThisTag.GeneratedContent = "<P" & variables.Style & ">" &
Replace(Replace(ThisTag.GeneratedContent, Chr(13) & Chr(10) & Chr(13) &
Chr(10), "</P><P" & variables.Style & ">", "ALL"), Chr(13) & Chr(10),
"<BR>", "ALL") & "</P>">
</CFIF>



-- 
Aidan Whitehall <[EMAIL PROTECTED]>
Netshopper UK Ltd
Advanced Web Solutions & Services

http://www.netshopperuk.com/
Telephone +44 (01744) 648650
Fax +44 (01744) 648651

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 23 October 2000 19:24
> To: CF-Talk
> Subject: RE: An Idea about access and paragraphs
> 
> 
> > So, here's my idea. Access cannot literally store paragraphs
> > however you can
> > always put in <P> at the start of each paragraph/line and 
> achieve the the
> > paragraphs. The drawback to this is that if it is left up 
> to the regular
> > user, they'll probably mess it up.
> >
> > So, this is the idea. Is there a way to detect a paragraph break,
> > then when
> > you submit the page, the paragraph break is detected, and then
> > replaced with
> > a <P> tag. Therefor all the user has to do, is put in a 
> normal paragraph.
> 
> Great idea! Allaire must have had the same one, since they've 
> given us the
> ParagraphFormat() function, which substitutes CRLF strings 
> into <p> strings
> for display purposes.
> 
> I prefer to do it manually, however, with a Replace function, 
> and replace a
> CRLF with <br> instead, since users will sometimes use just 
> one CRLF for
> things like address formatting, and two for actual paragraphs.
> 
> Ron Allen Hornbaker
> President/CTO
> Humankind Systems, Inc.
> http://humankindsystems.com
> mailto:[EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to