# $field->toPage()

Returns a page object from a page id in the field

****

- Source: <https://github.com/getkirby/kirby/tree/5.5.3/config/methods.php#L241>

****

```php
$field->toPage(): Kirby\Cms\Page|null
```

## Return types

`Kirby\Cms\Page` or `null`

This method modifies the existing `$field` object it is applied to and returns it again.


## Examples

```php
<?php if ($related = $page->related()->toPage()): ?>
  <p><a href="<?= $related->url() ?>">Read more…</a></p>
<?php endif ?>
```