Kirby V4 - Link field - Block error: "Object of type Kirby\Content\Field is not callable" in block type

Hello together.

Loving the new link field, but I can’t get it run in my block element. I’m sure, everything is correctly implemented, but maybe I’m missing something.

$link1          = $block->link1();
...
<a href="<?= $link1()->toUrl() ?>" class="button button--primary"><?= $link1() ?>

In the kirby panel it looks good and i can select any targets. But I’ll get this error message in the frontend.

Object of type Kirby\Content\Field is not callable" in block type

Maybe someone had a similar issue or can give me a hint, why it doesn’t work for me.

Thx!

Christian

The error is the parenthesis here, you are trying to call the variable as if it was a function.

OF COURSE … now I see it myself :man_facepalming:

Thank you very much for your quick help.