I tried the solution in that post, but got this error (while trying to open sitemap.xml from the browser);
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<b>Notice</b>
: Trying to get property of non-object in
<b> G:\xampp\htdocs\test-site\kirby\branches\multilang\page.php </b>
on line <b>70</b>
<b>Notice</b>
: Trying to get property of non-object in
...
...
I know it has something to do with the language-set in config.php (when I delete the code below, the sitemap works).
Just for the others, who encounters this same error (creating a sitemap, while having a language set in your config.php), this is the code in /site/templates/sitemap.php
Generally you wouldn’t add it to the template but to the route, that’s why it is documented in the Routing docs. You don’t need to use it for normal templates.
Yes, you are as always right, but I would not search there, if I don’t know that place.
I would look at http://getkirby.com/docs/cheatsheet#site and I find nothing.
That was, what I have said.
I know that there is a difference between $site and site(), but I have looked at the wrong place.
site()->visit() is a method that’s only useful in context of routing. I would never search for it specifically. That’s why it isn’t in the cheat sheet: To keep the cheat sheet clean so it can answer questions like “how can I get the URI of the page?” more quickly.