Basic return url query

Apologies for the basic question in advance as I am very new to kirby. I’ve just looked through the forum boards but I don’t seem to be able to find a solution to this:

<p class="banner-title"><a href="<?= $page->url()?>"><?= $page->text() ?></a></p>

I’m trying to return the text and a URL from my input in the panel. I can return the text just fine using

<?= $page->text() ?>

but when I try to do a similar thing for the URL it simply returns the URL of the current page, not the one I’ve entered in the URL field in the panel. I imagine it’s a really simply solution but I can’t work it out at all! Thanks in advance for your help :slight_smile:

$page->url() is a function of the $page object, rename your field in the blueprint and it will work :slight_smile:

1 Like

… alternatively you can use …

<?= $page->content()->url(); ?>

Assuming that your field key in your blueprint is url.

1 Like

Thank you both @flokosiol & @Pascalmh :slight_smile: – I finally get it! Both of yours answers answer a lot of other questions I had as well so thanks for getting back so quickly!

1 Like