Kirbytext not working

I am having trouble making markdown render with kirbytext on my pages. For example:

when I type #Hello world in the admin panel for that page, it render on the page as #Hello world in plain text.

In my template I have: <?= $page->Linkto()->kirbyText() ?>
and in the blueprint:

linkto:
label: Linkto
type: markdown

I also have c::set(‘markdown.extra’, true);

I wondered if it was due to <?= $page->Linkto()->kirbyText() ?> being located within an html element, but it seems to not be a problem with markdown.extra .
Any help would be greatly appreciated, as it seems a simple thing, yet I am not able to make it work.

Should be

<?= $page->Linkto()->kirbytext() ?>

Method names are case sensitive.

It gives me an error when I write it like in your case:

This page is currently offline due to an unexpected error. We are very sorry for the inconvenience and will fix it as soon as possible.

Advice for developers and administrators:
Enable debug mode to get further information about the error.

This is the error it gives me:
Method Kirbytext::__toString() must not throw an exception, caught Error: Class ‘DOMDocument’ not found

at 0
Whoops\Exception\ErrorException
…/helpers.php0

Ok, let’s start with the debugging part. In. your config.php, add this line:

c::set('debug', true);

Then you should get a nice error message instead of the meaningless error page.

Edit: see this post Error: Class 'DOMDocument' not found

1 Like

Ok, I had to install php xml and restart apache - sudo apt-get install php-xml

1 Like