# Blog Excerpt with Editor plugin - need help

**URL:** <https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462>\
**Category:** Questions\
**Tags:** v3\
**Created:** [February 29, 2020, 4:19pm UTC](https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462 "2020-02-29T16:19:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emmit\_Jones](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/emmit_jones/32/7772_2.png) [@Emmit\_Jones](https://forum.getkirby.com/u/Emmit_Jones)\
**Post date:** [February 29, 2020, 4:19pm UTC](https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462/1 "2020-02-29T16:19:51Z")

</div>

Please forgive, this may be simple, but I’m a noob. My blog excerpts are not displaying properly. I implemented the Kirby Editor plugin, which is working well. But on my Articles page i’m getting additional text in the excerpt. see image below.

 ![Screen Shot 2020-02-29 at 11.14.47 AM](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/1/1aa507cc2665319f2057fa1b7e42c692db64fad4.png)

I’m displaying the excerpt this way

```
 `<?= $article->text()->excerpt('100') ?>`

```

with my blueprint as such

```
text:
    label: Article Content
    type: editor
    size: large
    files: page.images
    image:
      cover: true
    uploads: textarea-upload

```

thanks.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 29, 2020, 5:23pm UTC](https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462/2 "2020-02-29T17:23:54Z")

</div>

You have to output the editor field with the `blocks()` method

```auto
<?= $article->text()->blocks() ?>

```

Then you should be able to string `excerpt()` onto it:

```auto
<?= $article->text()->blocks()->excerpt() ?>

```

---

<div class="post-metadata">

**Author:** ![Emmit\_Jones](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/emmit_jones/32/7772_2.png) [@Emmit\_Jones](https://forum.getkirby.com/u/Emmit_Jones)\
**Post date:** [February 29, 2020, 6:00pm UTC](https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462/3 "2020-02-29T18:00:18Z")

</div>

Yeah, ugh. It’s wierd. That was first thing I had tried like below… but was throwing an error. now it’s working. Not sure why. maybe I was using block() instead of blocks()

\<?= $article-\>text()-\>blocks()-\>excerpt('100') ?\>

Thank you!

---

<div class="post-metadata">

**Author:** ![GianlucaSavini](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gianlucasavini/32/9765_2.png) [@GianlucaSavini](https://forum.getkirby.com/u/GianlucaSavini)\
**Post date:** [February 8, 2021, 2:30pm UTC](https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462/4 "2021-02-08T14:30:53Z")

</div>

I tried the solution given but it outputs this error:

InvalidArgumentException

The block type is missing

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [February 8, 2021, 4:38pm UTC](https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462/5 "2021-02-08T16:38:06Z")

</div>

@GianlucaSavini Are you using the Editor plugin? Are 3.5.x with the blocks field?

---

<div class="post-metadata">

**Author:** ![GianlucaSavini](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gianlucasavini/32/9765_2.png) [@GianlucaSavini](https://forum.getkirby.com/u/GianlucaSavini)\
**Post date:** [February 8, 2021, 5:14pm UTC](https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462/6 "2021-02-08T17:14:19Z")

</div>

Yes, I’m using 3.5.0 with the editor plugin.

the blueprint for the text field is

text:  
type: layout

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 8, 2021, 5:26pm UTC](https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462/7 "2021-02-08T17:26:40Z")

</div>

Then that’s not the Editor plugin, but the new [layout](https://getkirby.com/docs/reference/panel/fields/layout) field. The Editor plugin is not really compatible with Kirby 3.5.x (at least not at the moment).

There is no method to get an excerpt directly from the layout field. You would have to get the first layout element, then when you call `toBlocks()` on the first column, you could get an excerpt.

This is the standard code to display the contents of a layout field on the frontend:

```auto
<?php foreach ($page->layout()->toLayouts() as $layout): ?>
<section class="6-column-grid" id="<?= $layout->id() ?>">
  <?php foreach ($layout->columns() as $column): ?>
  <div class="column" style="--span:<?= $column->span(6) ?>">
    <div class="blocks">
      <?= $column->blocks() ?>
    </div>
  </div>
  <?php endforeach ?>
</section>
<?php endforeach ?>

```

So you first loop through the layouts, then the columns until you get to the blocks.

But of course, you can also fetch the first layout with

```auto
$layout = $layouts->first();

```

Then the first column:

```auto
$firstCol = $layout->columns()->first();

```

And then the blocks

```auto
echo $firstCol->blocks()->excerpt(200);

```

But whether this makes sense, depends on the content of your layouts…

---

<div class="post-metadata">

**Author:** ![GianlucaSavini](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gianlucasavini/32/9765_2.png) [@GianlucaSavini](https://forum.getkirby.com/u/GianlucaSavini)\
**Post date:** [February 8, 2021, 5:28pm UTC](https://forum.getkirby.com/t/blog-excerpt-with-editor-plugin-need-help/17462/8 "2021-02-08T17:28:08Z")

</div>

I’ll play with it, thanks very much
