Clickable link to another page with name

Hi there,
for the website of my meetup I need some help. The ‘meeting’ content of the page contains of meetings and each of them contains some talks. Every talk has a ‘speaker’-field that contains the link to the internal speaker profile as text, e.g. ‘speaker/john-doe’ How can I fetch the link as clickable URL? And as bonus the name of the speaker of the ‘name’-field would be great.
What I’ve got:

    <?php foreach($treffen->children() as $thema): ?>
  • <?php echo $thema->title()?>
    <?php echo $thema->speaker()->link() .'
  • <?php endforeach ?>

    Thanks in advance

    Maik

Hi, welcome to the Kirby forum.

You can get all the information from the speaker by converting it into a page object:

<?php
if ( $speaker = $thema->speaker()->toPage() ) :
  echo $speaker->url();
  echo $speaker->title(); // etc.
endif;

Hi pixelijn,

thanks for your answer! And this solution works for me! As always: It works, if you do it right…

Thank you!

Maik