Do a Find() or REFind() for the next occurrence of <p> after character
1900 (or whatever length) and go from there.

On 5/24/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> All,
>
> I've got a Web based admin tool that publishes articles.  Regardless
> of the length of the story, I'm trying to cut the story off the text at a
> certain length and display the "next page" hyperlink.  The code below does
> this ok.
>
> However, I want to detect the end of the paragraph so the reader completes
> the paragraph before having to click on the "next page" link.  Each paragraph
> is always separated by a single <p> tag.  Right now, with the code below, I'm
> gettiing words cut into peices and incomplete paragraphs.
>
> Any advice or gauidance would be much appreciated.
>
> <CFSET first_length = 1900>
> <CFSET story_length = Len(pressrel_story.pre_mainpress)>
> <CFSET story_remaining = #story_length# - 2500>
>
> <tr>
>   <td colspan="2">
> <p><cfoutput>
> <span class="second_para">#left(pressrel_story.pre_mainpress, first_length)# 
> ....</span>
> </cfoutput>
> <p>
>         </p>
> <span class="second_para"><a href="pagename.cfm?sr=#story_remaining#">Next 
> Page</a></span>

-- 
CFAJAX docs and other useful articles:
http://jr-holmes.coldfusionjournal.com/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241270
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to