How get the Content from other page

Hi,
this ist my first and i guess, not my last project with kirby :wink:

…but one thing to do:
I need Content/field from one template in an other.
In the first Template i have $page->freigestellt()->toFile() and i need this in an other template.

Thx, Maras

With $page you have access to the current page.

But you can use Kirby’s page helper to fetch an other page by path:

<?php if ( $p = page('path-to-page') ) {
  echo $p->title();
}
?>

For example, if you have a page on the first level with a folder name blog:

page('blog')

or an article inside blog

page('blog/article-1')

Welcome :slight_smile: I hope you enjoy working with Kirby.

1 Like