4.8 KiB
Blog System
CMS kit provides a blog system to add blogs & posts to a public website. This section describes the details of the blog system.
Feature
CMS kit uses the global feature system for all implemented features. Commercial startup templates come with all the CMS Kit-related features are enabled by default, if you create the solution with the public website option. If you're installing the CMS Kit manually or want to enable the blog feature individually, open the GlobalFeatureConfigurator class in the Domain.Shared project and place the following code to the Configure method.
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit =>
{
cmsKit.Blogs.Enable();
});
Internals
Domain Layer
Aggregates
This module follows the Entity Best Practices & Conventions guide.
Blog(aggregate root): Presents blogs of application.BlogPost(aggregate root): Presents blog posts in blogs.BlogFeauture:(aggregate root): Presents blog features enabled/disabled state. Such as reactions, ratings, comments etc.
Repositories
This module follows the Repository Best Practices & Conventions guide.
Following custom repositories are defined for this feature:
IBlogRepositoryIBlogPostRepositoryIBlogFeatureRepository
Domain services
This module follows the Domain Services Best Practices & Conventions guide.
BlogManager: Includes some operations forBlogaggreate root to keep data consistency.CreateAsync: Creates a newBlogentity and makes sure slug is used one time.UpdateAsync: Updates existingBlogentity and makes sure slug is used one time.
BlogPostManager: Includes some operations forBlogPostaggreagate root such as creating & updating.CreateAsync: Creates a new BlogPost and makes sure slug is used only one time.SetSlugUrlAsync: SetsUrlSlugproperty of BlogPost entity and makes sure slug isn't duplicated in same blog.
BlogFeatureManager: Includes some operations for managing blog features.SetAsync: Sets a feature enabled/disabled for a Blog.SetDefaultsAsync: Resets all feature configuration for a Blog.
Application layer
Application Services
Admin
BlogAdminAppService(implementsIBlogAdminAppService): Implements use cases of blog management.BlogFeatureAdminAppService(implementsIBlogFeatureAdminAppService): Implements use cases of blog feature management.BlogPostAdminAppService(implementsIBlogPostAdminAppService): Implements use cases of blog post management.
Common
BlogFeatureAppService(implements IBlogFeatureAppService): Implements feature checking operations.
Public
BlogPostPublicAppService(implementsIBlogPostPublicAppService): Implements use cases of blog posts management on public websites.
Database providers
Common
Table / collection prefix & schema
All tables/collections use the Cms prefix by default. Set static properties on the CmsKitDbProperties class if you need to change the table prefix or set a schema name (if supported by your database provider).
Connection string
This module uses CmsKit for the connection string name. If you don't define a connection string with this name, it fallbacks to the Default connection string.
See the connection strings documentation for details.
Entity Framework Core
Tables
- CmsBlogs
- CmsBlogPosts
- CmsBlogFeatures
MongoDB
Collections
- CmsBlogs
- CmsBlogPosts
- CmsBlogFeatures
Admin UI
The blog system provides an admin UI to manage blogs, blogs posts & blog features by default. CMS menu will be available after a successful CMS Kit installation:
Managing Blogs
You need to start with adding a blog to your website. Go Cms -> Blogs menu and see the blog list. You can Create/Update & Delete blogs from here.
Managing Blog Features
Features can be configured per each Blog seperately. Go Cms -> Blogs menu and click the Featues menu item inActions menu.
Blog features can be configured with following modal.
Managing Blog Posts
Blog Posts can be managed from Cms -> Blog Posts menu. All blog posts will be listed in Public website at blogs/{blog}.
