Add text formatting to Kirby template $field->kirbytext()

Hi, I have a Kirby site developed by a developer but the text content formatting doesn’t work in the Kirby template, I believe I need to add in $field->kirbytext() somewhere but I’m not sure where?

When selecting text formatting, eg bullet, line breaks, strong - the text is plain unformatted and need to add HTML individually to format.

Any help appreciated thanks

Markdown and kirbytext in a textarea field need to be rendered in your templates using the kirbytext() method (or the shortcut kt()), that’s right.

Without knowing more details about your site, that’s hard to tell. Do a search for the field name over all files, or check the name of the affected content text file to find the right template.

1 Like

(post deleted by author)

Thank you I will have a look

@texnixe - does this look correct? if so where do I add $field->kt(…)

many thanks

I don’t know. Can you post a screenshot of a Panel view where you have added the content?


Thanks!

Ok, looks like you have to change

<?= $block->mainContent() ?>

to

<?= $block->mainContent()->kt() ?>

Yes perfect thank you that worked :smiley: