Kirby tags/ email encryption via writer

Hello! I use the WYSIWYG writer for my text blocks and I’m asking myself if it is possible to use Kirby tags inside the writer?

Example:
I want to add a class to a link, like this: (link:/page text:Link text class:button)

This only works if I render <?= $page->text()->kt() ?> instead of <?= $page->text() ?>, right?
Are there any disadvantages to using Kirbytext for Writer content?

What I’m wondering about most is how to encrypt email addresses via writer. If I use the Kirby tag (email:…) here, the email address is rendered as kt() and automatically encrypted. If I use the email function in the writer, it’s not happening.

Glad about some input! :slight_smile:

Hm, if you want to use KirbyTags, why don’t you use a textarea/markdown field in the first place.

Having said that, I’m not aware of issues with using Kirbytags in a writer field.

If this works as @texnixe assumes, you’d need to use the kt() function to convert it properly, yes.

[quote=“Nelli, post:1, topic:27017”]
What I’m wondering about most is how to encrypt email addresses via writer. If I use the Kirby tag (email:…) here, the email address is rendered as kt() and automatically encrypted. If I use the email function in the writer, it’s not happening.[/quote]

What do you mean by encrypted? Usually, Kirby does nothing else than setting this as a mailto: link but no encryption. That is because Kirby doesn’t interfere with the frontend and an base64 encrypted string needs to be decrypted via JavaScript in the client again.

Maybe a better idea would be to extend the writer by adding one of these plugins:

If you use the email KirbyTag, Kirby encodes (Str::encode()) the email address, not really encryption, rather obfuscation.