I’d like to replace the quotation marks in the content of a textarea field before echoing it as individual paragraphs (the way they usually would be, using kirbytext()
).
Replacing the quotation marks works fine, but how can I now echo my field content as individual p-tags? Here’s the problem:
<?php if($post->$field()->isNotEmpty()): ?>
<?php
$content = $post->$field();
$content = Str::replace($content, '„', '»');
$content = Str::replace($content, '“', '«');
?>
<div><?= $contentNew->kirbytext() ?></div>
<?php endif ?>
This will of course not work. But how do I treat the changed content to get the same result as if I was using a regular, unchanged field output?