Getting URL field in template

So I have a URL input on a blueprint:

And I’m trying to get the url in there to output in my template. I currently have:

<?php $page->field()->URL() ?>

But that’s not correct. And I’ve tried just about every variation on that and can’t figure it out.

Any ideas?

It would be just

<?php echo $page->fieldname() ?>

without the url() method.

Your code is missing the echo command, that’s why you get no output at all.

If your field is called url however, you would have to prepend the content() method, because url is a reserved word used by Kirby, see https://getkirby.com/docs/panel/blueprints/form-fields#field-names

<?php echo $page->content()->fieldname() ?>

As an alternative, you can rename your field.

2 Likes

Thanks so much! Of course URL is a resereved name. I should have thought of that.