ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Displaying only the 1st paragraph of a blog entry, with link to the entry

May 06, 2011 11:31am

Subscribe [2]
  • #1 / May 06, 2011 11:31am

    James Abbott

    22 posts

    Hi, is there a way to show first n words of a blog entry in EE? Alternatively, the first paragraph?

    I’m looking for a way to organize my /articles page. I need to display the list of latest articles where each list item is the first paragraph of the entry (not the article excerpt, but the first paragraph of the entry body), and have that paragraph link to the page for the full article.

    Right now it just displays the last entry (which is set by the limit=“1” attribute, see below):

    {exp:channel:entries channel="articles" limit="1" disable="pagination" status="Open | Featured Top Story"}
    <section id="main-entry" class="blog-entry-body group">
    <h2 class="blog-entry-title">{title}</h2>
    {article_body}
    </section>
    {/exp:channel:entries}

    Thanks, James

  • #2 / May 06, 2011 11:34am

    metadaptive

    96 posts

    As far as I’m aware, I don’t think there is a way to do this with native functionality, but there are a whole raft of character/word limit plugins on devot-ee:

    http://devot-ee.com/search/results/search&keywords=limit&channel=addons/

    Personally I’ve used TruncHTML without problems on quite a few sites.

  • #3 / May 06, 2011 12:16pm

    James Abbott

    22 posts

    Thanks. Upon second thought, I think I’ll go with excerpts anyway - I don’t like sentences being chopped off after a set number of characters. It’s not very reader-friendly in my opinion.

    Cheers, James

  • #4 / May 07, 2011 10:57am

    Sue Crocker

    26054 posts

    Thanks for the assist, metadaptive.

    James, I agree - excerpts give you much better control. Going to go and close this thread since you have a solution. Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases