Seems to be an easy question, but if i read the docs, i understand that site()->url() without a parameter should deliver the basic siteUrl without language slug - independently from which page i am calling - even in a multilanguage-setup.
When i am on a non-default language route i.e. test.com/de i get exactly that url - with de.
i am wondering, if that is the expected behavior?
Only site->url('') delivers the baseUrl without language-slug.
Do i made a mistake or is that the way to go?
hey @bnomei thanks for your response and the tip with kirby()->url()!
i will take that now.
regarding site()-url()
the base url of multi-language sites equals the one with the default language appended.
I thought so as well: without a parameter it should output the baseurl with the default language appended or none, if the url of the default-language is set to /.
In my case above, de is NOT the default language, but en with 'url=>/'
But on mydomain.com/desite()->url() without params outputs mydomain.com/de - and that is not the default lang
But i guess i found the use case: in a multilanguage setup with subpages, site()->url() outputs the baseUrl of the multilingual site
what i was looking for kirby()->url() is the better solution.
thx again