From 1ebf3c4077e259e467d4071da9aae1595014aade Mon Sep 17 00:00:00 2001 From: sbwalker Date: Sat, 30 Aug 2025 07:48:26 -0400 Subject: [PATCH] added StaticAssetPath properties to base classes --- Oqtane.Client/Modules/ModuleBase.cs | 11 ++++++++++- Oqtane.Client/Themes/ThemeBase.cs | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Oqtane.Client/Modules/ModuleBase.cs b/Oqtane.Client/Modules/ModuleBase.cs index 94cef77c..782a4b0a 100644 --- a/Oqtane.Client/Modules/ModuleBase.cs +++ b/Oqtane.Client/Modules/ModuleBase.cs @@ -140,13 +140,22 @@ namespace Oqtane.Modules } } - // path method + // path methods public string ModulePath() { return PageState?.Alias.BaseUrl + "/Modules/" + GetType().Namespace + "/"; } + public string StaticAssetPath + { + get + { + // requires module to have implemented IModule + return PageState?.Alias.BaseUrl + "_content/" + ModuleState.ModuleDefinition?.PackageName + "/"; + } + } + // fingerprint hash code for static assets public string Fingerprint diff --git a/Oqtane.Client/Themes/ThemeBase.cs b/Oqtane.Client/Themes/ThemeBase.cs index 4359f48e..d66ddb76 100644 --- a/Oqtane.Client/Themes/ThemeBase.cs +++ b/Oqtane.Client/Themes/ThemeBase.cs @@ -108,13 +108,22 @@ namespace Oqtane.Themes } } - // path method + // path methods public string ThemePath() { return PageState?.Alias.BaseUrl + "/Themes/" + GetType().Namespace + "/"; } + public string StaticAssetPath + { + get + { + // requires theme to have implemented ITheme + return PageState?.Alias.BaseUrl + "_content/" + ThemeState?.PackageName + "/"; + } + } + // fingerprint hash code for static assets public string Fingerprint {