A module for adding custom styles to your tenant. Below is a list of custom setting you may configure:
- Site Logo
- Site Favicon
This project is still in early stages and not ready for consumption.
You can inject the style setting into any view such as your theme layout.cshtml as follows:
@using OrchardCore.CustomStyleSettings.Services
@inject ICustomStyleSettingsService CustomStyleSettingsService
@{
var customStyleSettings = CustomStyleSettingsService.GetCustomStyleSettings();
}
You can now use your custom style settings to set your site favicon in your layout file as follows:
@if(@customStyleSettings.SiteFavicon==null)
{
<link type="image/x-icon" rel="shortcut icon" href="~/TheAdmin/favicon.ico" />
}
else
{
<link type="image/x-icon" rel="shortcut icon" href="@customStyleSettings.SiteFavicon" />
}
You can now use your custom style settings to set your site logo in your header menu as follows:
<a class="ta-navbar-brand" href="@Url.Content("~/")">
@if(@customStyleSettings.SiteLogo==null)
{
<span>@Site.SiteName</span>
}
else
{
<img src="@customStyleSettings.SiteLogo" class="navbar-brand-img" alt="...">
}
</a>
- Prerequisites: Make sure you have an up-to-date clone of the Orchard Core repository on the
dev
branch. Please consult the Orchard Core documentation and make sure you have a working Orchard before you proceed. You'll also, of course, need all of Orchard Core's prerequisites for development (.NET Core, a code editor, etc.). The following steps assume some basic understanding of Orchard Core. - Clone the module under
[your Orchard Core clone's root]/src/OrchardCore.Modules
. - Add the existing project to the solution under
src/OrchardCore.Modules
in the solution explorer if you're using Visual Studio. - Add a reference to the module from the
OrchardCore.Cms.Web
project. - Build, run.
- From the admin, enable the module's only feature.