I created a template called about.php that contains some informations like <?= $site->text()->kirbytext() ?> Because my about page is directly a content from the site.yml blueprint.
I would like to redirect the users to that about page from the home page.
Usually i’d use something like :
$site->find('something')->children()
But it’s not really possible in that case.
Somehow I can’t think of something that would work nicely.
is there another more dynamic option instead of using href="/about" ?
EDIT:
Or even better, is there a way I can sync some content of site.txt into my about.txt to make it more dynamic?
Redirect would mean, a user that hits the homepage is sent to the about page automatically. Is that would you want? Or do you want to show a link to the about page?
whoops, not redirect then,
just create a link <a href="/about"> about page </a>
But actually, I’m curious if there is a way to sync the content of the site.txt to another file.txt ?
Theoretically, yes, via a hook, but where’s the point in storing the same content twice?
Or put otherwise: Why do you store the content in site.txt instead of in the about page?
As you can see from the example above, you can access any page and it’s contents from anywhere using the page() helper method. Or find a page by template or any other criteria.