PDA

View Full Version : limit the text ouput



GeTSm0keD
March 25th, 2007, 08:33 AM
hey,

how would I go about limiting the text display from a database?

an example would be on alot of blogs,
how a blog message would be really long,

but on the main blog listing page,
it just has some teaser test,

today I went to the mall, meet this girl, and she totaly blew my.. READ MORE.

like that ^^

I dunno if this is a coldfusion thing or not,
but i'm developing in CF so..

bwh2
March 25th, 2007, 09:33 AM
well, there are a few ways to do this:

limit the main text to X number of characters in your SQL query. X is standard across all entries
limit the main text to X number of characters in your SQL query. X is different for each entry
have a separate field which holds your "preview" text
limit the main text in your server-side language.
combine some of the above methods

i favor having a separate field which holds the preview text. that way, my preview text doesn't have to be identical to the first portion of the full entry.

GeTSm0keD
March 25th, 2007, 10:33 AM
I found a very nice way to do this via coldfusion.

http://www.cflib.org/udf.cfm?ID=130

just to close my thread :-þ