Orchard CMS: Conditional CSS Class based on Layer
问题 I am trying to add a css class if I am in a particular layer. So 2 questions: Is it possible to identify the current layer in a Razor view. Something like: if(currentLayer == "TheHomepage") { ... } Is the the right way to approach HTML conditional on layer, or is there a better way to do this in Orchard? 回答1: If you need to see which layers are currently active, you can do something like this: @using Orchard.Widgets.Services @{ var widgetsService = WorkContext.Resolve<IWidgetsService>(); var