Problem outputting text

This code: <p><?php echo $site->zeiten(); ?></p> is in the footer.php which lives in the snippets folder.

footer.txt lives in the footer folder which lives in the content folder. It contains the following:

Titel: kontakt

zeiten: Montag-Donnerstag: 6:15-17:00 Uhr Freitag: 9:15-10:05 Uhr

Uuid: PhtgeR7NBU0wz3Wx

The footer.yml file lives inside the pages folder which lives inside the blueprints folder and has the following:

title: kontakt
preset: page
num: zero

draft: true
listed: true

label: Zeiten
type: text

For some reason, the the opening times are not being displayed.

$site refers to the site object, i.e. everything store in /content/site.txt, not any other pages.

So page('footer')->zeiten()

When I put it like this <p><?php echo $page ('footer')->zeiten() ?></p>
it returned: Object of type Kirby\Cms\Page is not callable

That is not what I wrote above…

In order to access the content of the /footer page you need to use the page() method and use that to access that specific page.

As @texnixe said, rather than using $site-> you need to use page('footer')->

It’s not working. I put it like this:

<?php echo $page('footer')->zeiten(); ?>

and the debugger returned: "Object of type Kirby\Cms\Page is not callable"

One thing that I wanted to clarify: The footer.php lives inside the snippets folder but there is a footer folder that lives inside the content folder itself. This footer folder contains the footer.txt file

Again, it’s page('footer') not $page('footer')

Yes, I tried it both ways and it now returns ‘footer’ <p><?php echo page('footer'); ?></p>

I also tried this: <p><?php echo page('footer')->zeiten(); ?></p>

page('footer')->zeiten(); is the correct code IF you indeed have a /footer folder inside /content

Which is probably not the case, in the end this folder is called contact or kontakt or whatever. Or it is not a direct child of /content, but nested somewhere below some other page.

Unfortunately, the information provided is always missing a lot of details.

I hope this clarifies it better:

content / footer / footer.txt

site / snippets / footer.php

Then this will work.

I just found out that the footer folder is not showing as an item in the control panel.

Ok, it worked. The footer folder was the problem. I renamed it kontakt and it worked. Many thanks for your support.