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? – Gaurav Agarwal Dec 14 '20 at 7:11
2

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.