fix theme fallback to use Oqtane themeinfo resources

This commit is contained in:
sbwalker
2024-02-28 15:53:31 -05:00
parent f439541844
commit 76680777ff
3 changed files with 20 additions and 10 deletions

View File

@ -364,17 +364,15 @@
page.ThemeType = site.DefaultThemeType;
}
var theme = site.Themes.FirstOrDefault(item => item.Themes.Any(item => item.TypeName == page.ThemeType));
Type themetype = Type.GetType(page.ThemeType);
if (themetype == null || theme == null)
if (theme == null)
{
// fallback to default Oqtane theme
page.ThemeType = Constants.DefaultTheme;
themetype = Type.GetType(Constants.DefaultTheme);
theme = site.Themes.FirstOrDefault(item => item.Themes.Any(item => item.TypeName == page.ThemeType));
}
Type themetype = Type.GetType(page.ThemeType);
string panes = "";
if (themetype != null && theme != null)
if (themetype != null)
{
// get resources for theme (ITheme)
page.Resources = ManagePageResources(page.Resources, theme.Resources, ResourceLevel.Page, alias, "Themes", Utilities.GetTypeName(theme.ThemeName));