Muut Archive Legend
@Muut · Joined 9 years ago · 18337 posts · 3878 topics · 137 reputation
Badges
Recent posts
-
Find out active language from Twig
· 11 years ago
it worked !!! it worked !!! ♪ ☆ !!! Thanks!!!
-
Find out active language from Twig
· 11 years ago
You could put custom language strings into either a global user/languages/en.yaml and user/languages/it.yaml, with: FOOTER_TEXT: "my custom footer text" Appropriately translated for each and then just
-
Find out active language from Twig
· 11 years ago
But probably you can also have a shorter code on base.thml/twig with having your translation in it.yaml, non?
-
Find out active language from Twig
· 11 years ago
☆ Excellent the footer ♪ ...
-
Find out active language from Twig
· 11 years ago
Using it within base.html.twig to change the footer according to the language: {% block footer %} <footer id="footer"> <div class="totop"> <span><a href="#" id="toTop"&g
-
Find out active language from Twig
· 11 years ago
Much more elegant. I will make a note of it. :)
-
Find out active language from Twig
· 11 years ago
Also you can do this: {{ grav.language.getActive }}
-
Find out active language from Twig
· 11 years ago
Ok, thanks! I guess that will do the job.
-
Find out active language from Twig
· 11 years ago
If you have the langswitcher plugin enabled there's a variable that returns the active language langswitcher.current. You can also see how they declared that variable in the plugin if you look into th
-
Find out active language from Twig
· 11 years ago
Is it possible to get active language from Twig? Something like: {% set language = some.way.to.find.out.active.language %} to be able to make conditional or dynamic include like: {% include language ~