How can i add the current year - type: text

Hi,

how can i add the current year in the panel if i add (date: year) in the textfield if i use the type: text?

If i use (date: year) with the type:textarea it works but not with the type:text.

Thank you

The content file does not care what the field in the panel looks like. It depends on how you echo the value.
Simply use the kirbytext() function and it will parse stuff like (date: year).

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

Please note that this also adds a surrounding <p> tag since it converts the value from markdown to HTML. If you don’t want this you can use something like that: https://github.com/jbeyerstedt/kirby-plugin-kirbytextRaw

1 Like

Thank you thguenther,

this is wahat i need.
i change the field content from ->html() to the ->kirbytextRaw() function!

:+1: