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

How to get the version number of the active theme

Started by Muut Archive 10 years ago · 3 replies · 363 views
10 years ago

Hi guys,

Any ideas on which is the best way to get the version number of the active theme using Twig ? My best attempt so far is:

TWIG
{% set themeobj  = grav['themes'] %}
{% set themeinfo = themeobj.get(config.system.pages.theme).blueprints %}
<p id="theme-about">{{ themeinfo.name }} {{ themeinfo.version }}<p>

But it doesn't feel very idiomatic. I'm maybe missing something here.

Thank you very much for your time and help,

10 years ago

AFAIK that's the only way now, maybe we can add this information to the Theme object, so it's more easily accessible using grav.theme @rhukster?

10 years ago

Thank you for your quick reply @flaviocopes. +1 to have a shortcut through grav.theme

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1359 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago