evergreean43
Technical User
I need to show max words of 30 in my output of search variable output similiar to an article teaser. The output should show like this:
here is the teaser which should show 30 words.....
Here is how I think I can start but not sure because I cant figure the spaces in my word count:
Please advise how I can do this?
here is the teaser which should show 30 words.....
Here is how I think I can start but not sure because I cant figure the spaces in my word count:
Code:
<cfset charcount = 300>
<cfif Len(MyQuery.Article) gt charcount>
<cfset Variables.NewArticle = "#Left(MyQuery.Article, charcount)##ListGetAt(RemoveChars(MyQuery.Article, 1, charcount), 1, " ")#">
#Variables.NewArticle# ... < a href="filename.cfm?ArticleID=#MyQuery.ArticleID#"><more>
<cfelse>
#MyQuery.Article#
</cfif>
Please advise how I can do this?