Sunday, August 9, 2020 1:20:11 PM

Widget Menu for only one theme

5 years ago
#2486 Quote
How to get the widget Menu (for Fashion Theme) to only work/show in this theme? We have the possibility to choose between different themes on our site, but I only want the widget Menu to show when the Fashion theme is chosen. I think that it can be written in Plugins\Widgets.Menu\Views\WidgetsMenu\PublicInfo.cshtml in the if-statement
@if (Model.Categories.Count > 0) 
    <ul id="nav" class="dropdown dropdown-horizontal">
      <li><a class="home" href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>
      @foreach (var category in Model.Categories)
      @*<li>you can add here any menu item or before categories</li>*@
      <li><a href="@Url.RouteUrl("RecentlyAddedProducts")">@T("Products.NewProducts")</a>

but I don't know how to write it, something like & themename = "Fashion" ?? Appreciate help with this, to only show this menu when Fashion theme is chosen.
5 years ago
#2487 Quote
You can use

var themeName = EngineContext.Current.Resolve<IThemeContext>().WorkingThemeName;
Thank you for choosing our products!
We have something for you :)