Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Modular metadata description on language

Started by Muut Archive 11 years ago · 2 replies · 378 views
11 years ago

Hello,
I need to change the metadata description of a modular page depending on the language.

Could someone please explain how to do it?

11 years ago

Im new here but I think you can add the language key behind the module name like default.EN.md and need to set the language in the page header.
---twig
template: default.EN

TXT

So it will search for a `default.EN.html.twig` in your templates folder. 
There is also an other way with twig translation, but I did not understand it yet.

Here in the docs its better explained [Multi-Language](http://learn.getgrav.org/content/multi-language#language-based-twig-templates)
11 years ago

Thanks for your answer, I've tried again, now it works:

  • removed metadata: description: from site.yaml
  • renamed modular.md into modular.en.md
  • added metadata: description: to modular.en.md
  • copied modular.en.md to modular.it.md and changed the description

Probably looking for more complicate solutions messed up something.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1348 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2946 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago