Re: Limit number of words returned in a query

2007-12-09 Thread Dilbert
Thank you very much, the truncate function works very well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this

Limit number of words returned in a query

2007-12-08 Thread Dilbert
Let's say I have an article with a text field that is the full content. How can I have a preview of the text in the home page limiting the numbers of phrases or words (a bit like in drupal)? Thank you. --~--~-~--~~~---~--~~ You received this message because you are

Re: Limit number of words returned in a query

2007-12-08 Thread Dardo Sordi Bogado
Also you can retieve the fulltext and present a fragment in the view, look at the TextHelper in the api: http://api.cakephp.org/1.2/class_text_helper.html On Dec 8, 2007 12:31 PM, ianh [EMAIL PROTECTED] wrote: Various ways this could be done. A lot depends on how you need to call the

Re: Limit number of words returned in a query

2007-12-08 Thread ianh
Various ways this could be done. A lot depends on how you need to call the information throughout your app. Three possibilities are: 1. Store a preview field in your database and use the beforeSave callback in the model to auto-populate/update the field from submitted text; 2. Use the afterFind