Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Prompt: Create Theme
Purpose
Create a new storefront theme plugin, or override a subset of views in an existing theme, without forking the whole view tree.
Inputs Required
- Repository root.
- Theme name (used as
Theme.{Name}system name and as the view-location folder name). - Whether the theme is a full theme or a small override on top of the default views.
- Which pages or components the theme changes.
- Whether the theme ships its own CSS/JS, and whether it needs the Vite build.
Steps
- Read
.ai/skills/theme-creation.md— it is the authority forIThemeView, view-location fallback, and asset layout. - Read
.ai/knowledge/template-types.mdfor the view conventions of the area you are overriding. - Read
.ai/templates/theme/for the skeleton files. - Inspect
src/Plugins/Theme.Modern/as the reference implementation. - Create the project:
Theme.{Name}.csproj—Microsoft.NET.Sdk.Razor,AddRazorSupportForMvc,StaticWebAssetsEnabled=false, output to..\..\Web\Grand.Web\Plugins\Theme.{Name}\.Manifest.cs—Group = "Themes".{Name}ThemePlugin.cs—BasePlugin, IPlugin.{Name}ThemeView.cs—IThemeViewwith the view-location list.StartupApplication.cs—services.AddScoped<IThemeView, {Name}ThemeView>().Views/{Name}/_ViewImports.cshtmland_ViewStart.cshtml.Content/with CSS, scripts, images, andtheme.jpgpreview.logo.jpg.
- Copy only the views the theme actually changes into
Views/{Name}/. The fallback locations resolve everything else fromGrand.Web. - Confirm each copied view still binds the same
@modeland keeps the storefront data attributes described in.ai/knowledge/template-types.md. - If the theme changes bundled frontend assets, follow
.ai/skills/frontend-bundle-workflow.mdand commit the generated bundle alongside the source. - Build and confirm
Views/andContent/land undersrc/Web/Grand.Web/Plugins/Theme.{Name}/.
Mandatory Rules
IThemeView.ThemeNamemust match the folder name underViews/.GetViewLocations()must end with the default fallbacks"/Views/{1}/{0}.cshtml"and"/Views/Shared/{0}.cshtml", so uncopied views still resolve.AreaNameis""for storefront themes.ThemeInfo.PreviewImageUrlmust point at a file that exists under~/Plugins/Theme.{Name}/Content/.- Do not copy the whole
Grand.Web/Viewstree — every copied view is a file that must be maintained against upstream changes. - Do not change view models, route names, or controller contracts from inside a theme.
- Preserve
data-cart-action, product IDs, quick-view URLs, wishlist, compare, and add-to-cart attributes in copied views. - Keep
Content/**andlogo.jpgonCopyToOutputDirectory=PreserveNewest.
Output Format
- Theme: system name, theme name, full theme or override.
- View locations: the
GetViewLocations()list, with a note on what falls back to default. - Views copied: each path + what changed in it.
- Assets: CSS/JS files added and whether a bundle rebuild was required.
- Validation: build result and confirmed output path.
- Upstream risk: which copied views are most likely to drift from
Grand.Webon upgrade.