Show entire Blogposts with dividers

Hey there,

I’m super new to Kirby and just trying to learn a lot. I setup my website and made a Blog with the instructions. but I want my Blog to display all the content without clicking on the “Read More” Field.

This is the foreach loop out of the cookbook:

 <?php foreach($page->children()->listed()->flip() as $article): ?>
  <h1><?= $article->title()->html() ?></h1>
  <p><?= $article->text()->excerpt(300) ?></p>
  <a href="<?= $article->url() ?>">Read more…</a>
<?php endforeach ?>

So far everything is working as it should, but I can’t figure out how to let my Blog display the full contents of all the posts (Text, video, image) in reversed order with dividers and date in between them.

Sorry for bothering you, I know it’s a total beginner question but I’m not (yet :slight_smile:) into web developing.

Hey, welcome to the community.

All you need to do is swap excerpt for kt(). This will turn the entire markdown field into html, whereas excerpt was giving you just the first 300 chars.

<?= $article->text()->kt() ?>
1 Like

You can find all the available field methods here:

Field methods are called on a field and do different stuf with a field’s value: output it in a special way, convert, check for values etc.

kt() is the short version kirbytext().

Dividers like horizontal rules etc. after an article are best added through your stylesheet, not in the code.

1 Like

awesome, thanks so much @jimbobrjames and @texnixe
that is exactly what I wanted.