Hello
I have the following problem I would like the Parameter “number_slogan_info” to be dynamic. Is this somehow possible?
Currently the it works like this:
1) in the “config.json” I have set the parameter number_slogan_info
...
"params": {
"header_img": "img/header_250.png",
"number_slogan_info": 4,
...
},
...
2) In the language file of i18n I then defined the slogans (for each language different of course)
…
"slogan_info_0": {
"other": "Security Management - ISMS27001 & Ethical Hacker"
},
"slogan_info_1": {
"other": "Agile Project Management - Scrum & Kanban"
},
"slogan_info_2": {
"other": "IT Service Management - ISMS20000 & FitSM"
},
"slogan_info_3": {
"other": "DevOps - Continuous Integration & Continuous Delivery"
},
…
3) In the home.html I do …
...
<div id="typing">
<ul id="typing-carousel-data">
{{ range $i, $sequence := (seq .Site.Params.number_slogan_info) }}
{{ $i18n_tag := print "slogan_info_" $i }}
<li> {{ $i18n_tag | i18n }}</li>
{{ end }}
</ul>
</div>
...
I would now like to make the parameter dynamic. It shall work without definition of the max value “number_slogan_info” in the config.json.
Can I modify the loop so that it reads from the Language file until no more slogans are delivered?
So when I want to add another slogan – I just add a slogan in the en.json, de.json, fr.json … without editing config.json. For the start we can assume that in every langfile we have the same number of slogans …
Thanks for your help
rob