-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISiteThemeService GetSiteThemeAsync() returns the front-end theme on the Admin page #15150
Comments
Please use |
I checked I want to determine inside of a Middlaware whether the Current Theme is using Lombiq.BaseTheme as its BaseTheme. The problem here is now that I can't determine if I am on the admin page because the above described services will not return So my problem is that I want to get the CurrentTheme that is now being displayed and if that is the So after debugging into |
Use |
However, I believe we tried that during our debugging session @Psichorex and it also always returned the site theme, even when on the dashboard. Please check with the latest source though. |
Please tell how it works for you as mentioned above. |
That's because middleware runs before filters. Creating MVC action filter instead of middleware will solve your problem. |
As per @ns8482e said I couldn't use |
Describe the bug
Injecting
ISiteThemeService siteThemeService
orIThemeManager
and calling eitherGetSiteThemeAsync
orGetThemeAsync()
will return the Front-end theme instead of the admin theme.I want to determine inside of a Middlaware whether the Current Theme is using Lombiq.BaseTheme as its BaseTheme.
If yes I want to remove bootstrap resources.
The problem here is now that I can't determine if I am on the admin page because the above described services will not return TheAdminTheme but the frontend theme only.
So my problem is that I want to get the CurrentTheme that is now being displayed and if that is the TheAdminTheme I don't want to remove bootstrap as it will destroy the admin page.
To Reproduce
Steps to reproduce the behavior:
IThemeManager GetThemeAsync()
orISiteThemeService GetSiteThemeAsync()
Expected behavior
It should return TheAdminTheme
Screenshots
Screenshots are made from a fresh clone of the OrchardCMS repository so it is not my local project.
The text was updated successfully, but these errors were encountered: