Hi,
I try to display a menu in the footer, but the list items are empty.
Here is my toml.cfg:
[menus]
[[menus.footer]]
name = 'Stackoverflow'
url = 'https://stackoverflow.com'
weight = 10
[[menus.footer]]
name = 'github'
url = 'https://github.com'
weight = 20
[[menus.footer]]
name = 'youtube'
url = 'https://youtube.com'
weight = 30
[[menus.footer]]
name = 'FreeCodeCamp'
url = 'https://freecodecamp.com'
weight = 40
And this is my footer.html:
<div class="col-sm-12 col-lg-2">
<h3 class="footer-head">Social Media</h3>
<ul class="footer-links">
{{ range site.Menus.footer }}
<li class="footer-list">
<a href="{{ .URL }}">
{{ .Name }}
</a>
</li>
{{ end }}
</ul>
</div>
https://github.com/malde11/portfolio
Hope someone can help me, thanks
You have already declared menus to be language specific, so you must do that with all entries.
OK… and how do I do it, if the links and the name are the same in english and german?
Just like you did the others.
I am confused now…
here is my config:
[languages]
[languages.de]
languageCode = 'de-DE'
languageName = 'Deutsch 🇩🇪'
contentDir = 'content/de'
weight = 1
[languages.de.menus]
[[languages.de.menus.main]]
name = 'Startseite'
pageRef = '/'
weight = 10
[[languages.de.menus.main]]
name = 'Logos'
pageRef = '/logos'
weight = 20
[[languages.de.menus.main]]
name = 'Sketches'
pageRef = '/sketches'
weight = 30
[[languages.de.menus.main]]
name = 'Fotos'
pageRef = '/fotos'
weight = 40
[[languages.de.menus.main]]
name = 'Tutorials'
pageRef = '/tutorials'
weight = 50
[[languages.de.menus.main]]
name = 'Kontakt'
pageRef = '/kontakt'
weight = 60
[languages.de.test]
[[languages.de.test.socialmedia]]
name = 'Stackoverflow'
url = 'https://stackoverflow.com'
[[languages.de.test.socialmedia]]
name = 'github'
url = 'https://github.com'
[[languages.de.test.socialmedia]]
name = 'youtube'
url = 'https://youtube.com'
[[languages.de.test.socialmedia]]
name = 'FreeCodeCamp'
url = 'https://freecodecamp.com'
[languages.en]
languageCode = 'en-US'
languageName = 'English 🇬🇧'
contentDir = 'content/en'
weight = 2
[languages.en.menus]
[[languages.en.menus.main]]
name = 'Home'
pageRef = '/'
weight = 10
[[languages.en.menus.main]]
name = 'Logos'
pageRef = '/logos'
weight = 20
[[languages.en.menus.main]]
name = 'Sketches'
pageRef = '/sketches'
weight = 30
[[languages.en.menus.main]]
name = 'Photos'
pageRef = '/fotos'
weight = 40
[[languages.en.menus.main]]
name = 'Tutorials'
pageRef = '/tutorials'
weight = 50
[[languages.en.menus.main]]
name = 'Contact'
pageRef = '/kontakt'
weight = 60
[languages.en.test]
[[languages.en.test.socialmedia]]
name = 'Stackoverflow'
url = 'https://stackoverflow.com'
[[languages.en.test.socialmedia]]
name = 'github'
url = 'https://github.com'
[[languages.en.test.socialmedia]]
name = 'youtube'
url = 'https://youtube.com'
[[languages.en.test.socialmedia]]
name = 'FreeCodeCamp'
url = 'https://freecodecamp.com'
and I get this error:
ERROR deprecated: config: languages.en.test: custom params on the language top level was deprecated
The message says " custom params on the language top level was deprecated".
You need to place language-specific parameters under the language-specific param key…
[languages.xx.params]
foo = 'bar'
malde11
7
I have changed it like this:
[languages.de.params]
[[languages.de.params.socialmedia]]
name = 'Stackoverflow'
pageRef = 'https://stackoverflow.com'
[[languages.de.params.socialmedia]]
name = 'github'
pageRef = 'https://github.com'
[[languages.de.params.socialmedia]]
name = 'youtube'
pageRef = 'https://youtube.com'
[[languages.de.params.socialmedia]]
name = 'FreeCodeCamp'
pageRef = 'https://freecodecamp.com'
I get no errors, but the menu is not displayed.
Do not know what I am doing wrong.
Those look like menu entries, not parameters. If so, please see the documentation on menu entry creation. There’s a multilingual example.
malde11
9
OK, got it now:
[languages.en]
languageCode = 'en-US'
languageName = 'English 🇬🇧'
contentDir = 'content/en'
weight = 2
[languages.en.menus]
[[languages.en.menus.main]]
name = 'Home'
pageRef = '/'
weight = 10
[[languages.en.menus.main]]
name = 'Logos'
pageRef = '/logos'
weight = 20
[[languages.en.menus.main]]
name = 'Sketches'
pageRef = '/sketches'
weight = 30
[[languages.en.menus.main]]
name = 'Photos'
pageRef = '/fotos'
weight = 40
[[languages.en.menus.main]]
name = 'Tutorials'
pageRef = '/tutorials'
weight = 50
[[languages.en.menus.main]]
name = 'Contact'
pageRef = '/kontakt'
weight = 60
[[languages.en.menus.footer]]
name = 'github'
pageRef = 'https://github.com'
weight = 10
[[languages.en.menus.footer]]
name = 'Stackoverflow'
pageRef = 'https://stackoverflow.com'
weight = 20
[[languages.en.menus.footer]]
name = 'youtube'
pageRef = 'https://youtube.com'
weight = 30
[[languages.en.menus.footer]]
name = 'FreeCodeCamp'
pageRef = 'https://freecodecamp.com'
weight = 40
Thanks for the hint
system
Closed
10
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.