Friday, December 10, 2010

How to publish first paragraph only

I want to make an index page or blog posts and display the most recent
articles as a list, with title, author, date, and also the first
paragraph. The way it is done at the Bakery: http://bakery.cakephp.org/articles

I've looked at Text Helper functions excerpt() and truncate() but
neither seems able to do it. If we use truncate for example and
publish the first 100 characters this will either cut the paragraph
short or publish part of the second paragraph.

Is the best solution to add an extra column in the posts database
table called 'intro' where the author can put the paragraph or other
intro text to the article?

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate