Sunday, May 26, 2019 7:23:17 AM

Widget Menu for only one theme

4 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) 
{
  <nav>
    <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)
      {
        @RenderCategoryLine(category)
      }
      @*<li>you can add here any menu item or before categories</li>*@
      <li><a href="@Url.RouteUrl("RecentlyAddedProducts")">@T("Products.NewProducts")</a>
</li>
    </ul>
  </nav>
}


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.
0
4 years ago
#2487 Quote
Hello,
You can use

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