Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Use 2 Metronic themes in same app #6983


User avatar
0
daws created

We're building an angular application with two separate web pages which share services and components.

We would like one of these pages to use the default Metronic theme (with the menu on the left side) and the other one to use the theme2 (with the menu in the topbar). Is it possible to use both themes in the same app ? We started from the zero 6.4 template.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @daws,

    You can return name of one of the themes which has top layout here https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/app/shared/layout/themes/ThemeHelper.ts#L12 according to current route.

  • User Avatar
    0
    daws created

    To make it work, I also had to change :

    • getThemeColor (since in DynamicResourceHelper, the themeColor is used to load most of the assets of the theme, not only the color)

    and create a :

    • GetCurrentLoginInformation(string theme) in the SessionAppService in order to choose which UICustomizer I need from the frontend.

    Maybe there was another way ? If not, you can close this topic :)

    Thanks anyway !

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @daws

    Actually, I couldn't come up with another idea.