Escaping kirbytext() and kirby 2 to kirby 3

Hi

On this page:

https://juliegrahame.com/contact

I have a class on a link like so in the admin panel:

- (email: julie@juliegrahame.com text: <span class="fa fa-envelope-o fa-lg fa-fw"></span> email me)

I am upgrading to from Kirby 2 to Kirby 3. I use this code to output the admin panel content:

<?php echo $page->text()->kirbytext() ?>

In kirby 2 it does appear to be escaped, in kirby3 it is. Is this correct? How can I add code in kirby 3?

Thank you!

Regards
Mike

I walked away after an hour, came back, and of course, it all makes more sense.

I read this earlier, but it only made sense just now:

and I am using html_entity_decode() around ->kirbytext() to display the HTML tags as HTML. Still not sure this is the best idea, but it works.

Thank you!

Regards
Mike

What I would do instead is:

  • create a custom email KirbyTag that overwrites the default tag
  • add a new parameter, maybe icon
  • modify the html output instead of using HTML::email to prevent the htmlentities.
1 Like

Thank you!