Title within kirbytext


I’m coding a website with a small “news” section, essentially half a dozen briefs that each consist of about 3 lines. Layout-wise, we want to achieve the following:

The title - 11.03.2016: Lorem ipsum bla bla bla…

Now the contributor(s) being web-illiterate, we thought about splitting the Title, the Date and the Text in three separate fields, each having a specific section in the Panel (forgive the incorrect terminology used here, I hope it’s nonetheless clear).

Problem: the Text needs to be interpreted as kirbytext, yet remain on the same line as the Title and the Date, and thus not be wrapped in P tags.

I already tried the kirbytextRaw plugin, but somehow it does not interpret potential links included in the Text, so we have to look elsewhere.

Any idea would be greatly appreciated!


How about trying something like this:

<div class="mynews">
    <?= $page->title()->h() ?> - <?= $page->date('d.m.Y') ?>: <?= $page->text()->kt() ?>

With this CSS:

.mynews > p:first-child {
    display: inline;

Another option would be to use a custom field method that prepends the title and date before parsing the complete output through kirbytext.

Thanks, I’m way more at ease with CSS than with PHP, I’ll thus try the first solution, though the second would be an interesting challenge.