How to get current site theme from code behind? Is it also possible to use SXA tokens
?
1 Answer
You can use the following query to get the context site theme:
query:$theme
Also, if you want to get the site's theme programmatically you can do the following:
ServiceLocator.ServiceProvider.GetService<IThemingContext>().GetThemeItem(Sitecore.Context.Item, ServiceLocator.ServiceProvider.GetService<IContext>().Device)