Link to main language in multilingual section

I am only translating one section to another language, which means the main menu disappears when the language is switched. While someone can click on the site title to go to the main homepage, is there a way to add a link to the translated languages menu.toml to point to the main homepage? Adding / to the link goes to the languages root which has no posts since I am only translating a section (I also disabled homepage translation with if not .IsHome).

I am, and probably others are a bit confused when reading your question so I will try to split this and answer in parts. Hope this is what you mean, if not, let us know.


I am only translating one section to another language, which means the main menu disappears when the language is switched.

As I am aware, each language needs to have set menu elements in config file like

[[languages.pl.menu.footer]]
  identifier = "o"
  name = "O mnie"
  url = "/o/"
  weight = 1

[[languages.en.menu.footer]]
  identifier = "about"
  name = "About Me"
  url = "/en/about/"
  weight = 1

While someone can click on the site title to go to the main homepage, is there a way to add a link to the translated languages menu.toml to point to the main homepage?

Could you evaluate that as I am confused?

Adding / to the link goes to the languages root which has no posts since I am only translating a section

The link will require a function to provide something when part is not translated. Could you provide some examples?

would be happy to help, but struggle to get my head around it.

A convenient way to link to the first language:

<a href="{{ site.Sites.First.RelPermalink }">{{ site.Sites.First.Title }}</a>

I got this error execute of template failed at <site>: can’t evaluate field RelPermalink in type page.Site

<a href="{{ site.Sites.First.RelPermalink }}">{{ site.Sites.First.Title }}</a>

Quick google search of site.Sites.First.RelPermalink brought this this issue.

 <a href="{{ site.Sites.First.Home.RelPermalink }}">{{ site.Sites.First.Title }}</a>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.