Monday, January 3, 2011

Re: paginate posts substring body which uses tinymce - do i substr in the paginate or at the view?

> i am so ignorant.
>
> http://book.cakephp.org/view/1625/truncate
>
> this is the solution and a great one.

If the content comes from TinyMCE, it'll be html - so you could also
just strip off the first paragraph and show that in full, rather than
show part of a paragraph, something like
http://davidwalsh.name/php-paragraph-regular-expression would do it.
You could easily wrap that into a helper method, or if you need it in
a lot of places, you could grab in the afterFind of your model and add
an extra field to your dataset.

hth

Jon

--
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: