0

How to get current site theme from code behind? Is it also possible to use SXA tokens?

1
  • can you explain more what is your requirements? Commented Dec 14, 2020 at 7:11

1 Answer 1

3

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)

Not the answer you're looking for? Browse other questions tagged or ask your own question.