Page title is displayed, site title isn’t

Hey there, I upgraded my site to Kirby 3 and noticed that my <title> isn’t working correctly. It displays the page title, but the site title is being left out.

My code looks like this:
<title><?php echo $page->title()->html() ?> | <?php echo $site->title()->html() ?></title>

e.g.:

Project A | My Site

is now:

Project A |

Can anyone help?

Thanks in advance!

After upgrade, do you set title from panel dashboard under the topbar? Maybe you should save it after upgrade.

FireShot%20Capture%20710%20-%20M%C3%A6gazine%20-%20http___localhost_cms_kirby_panel_site

What is saved in your site.txt?

Are you using the Panel? If so, have you updated your site.yml?

Thanks for your reply!

The structure of my site.txt looks like this:

Title: …

----

Author: …

----

Description: …

----

Keywords: …

----

Copyright: © (date: Year)

I am using the panel. As far as I can tell, the site.yml has been updated. It now looks like this:

title: Site

sections:

  pages:
    headline: Seiten
    type: pages

Thanks for the reply. I don’t know if I understand you correctly, but the title is saved in the equivalent .txt-files.

So there is actually something stored in your site.txt, just wanted to make sure, because if you have a title field in your site.yml, the title text might have been deleted.

Is other content from site.txt rendered correctly, like the copyright information etc.?

I am afraid I cannot really tell whether the other content is being rendered because the title is the only information that is used (explicitly) within the site.

You could test and try and render anything in any template or snippet, e.g.

<?= $site->copyright() ?>

Thank you. It seems like the content is not being rendered. If I place <p><?= $site->copyright() ?></p> in a template, the only leftovers in the frontend are the empty <p></p> tags.

Seems that the file is not readable? Have you checked the file permissions?

Maybe delete the file and create a new one via the Panel. A new site.txt is created if you edit the site title in the Panel (via the edit icon that appears if you hover your mouse over the part above the open button)

47

It worked! I created a new .txt file via the panel and now, all titles are displayed correctly. Thank you very much for your quick and constructive help, Dankeschön!

1 Like

You are welcome!