-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8857 from abpframework/cms-kit-docs
CMS Kit Documentation
- Loading branch information
Showing
19 changed files
with
653 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,159 @@ | ||
# CMS Kit Module | ||
|
||
TODO | ||
This module provides CMS(Content Management System) capabilities for your application. | ||
|
||
* Provides a [**page**](cms-kit/) management system to manage dynamic pages. | ||
* Provides a [**blog**](cms-kit/) system to create blogs and publish posts. | ||
* Provides a [**tag**](cms-kit/Tag-Management.md) system to tag any kind of resources, like blog posts. | ||
* Provides a [**comment**](cms-kit/Comment-System.md) system to add comments feature to any kind of resource, like blog posts, products, etc. | ||
* Provides a [**reaction**](cms-kit/Reaction-System.md) system to add reactions feature to any kind of resource, like blog posts or comments. | ||
* Provides a [**rating**](cms-kit/Rating-System.md) system to add rating feature to any kind of resource. | ||
|
||
## How to install | ||
|
||
The ABP CLI allows adding a module to a solution using `add-module` command. CMS kit module can be added using the command below; | ||
|
||
```bash | ||
abp add-module Volo.CmsKit | ||
``` | ||
Open the `GlobalFeatureConfigurator` class in the `Domain.Shared` project and place the following code to the `Configure` method to enable all features in the CMS kit module. | ||
|
||
```csharp | ||
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit => | ||
{ | ||
cmsKit.EnableAll(); | ||
}); | ||
|
||
``` | ||
|
||
> If you are using EntityFrameworkCore, do not forget to add a new migration and update your database. | ||
## Packages | ||
|
||
This module follows the [module development best practices guide](https://docs.abp.io/en/abp/latest/Best-Practices/Index) and consists of several NuGet and NPM packages. See the guide if you want to understand the packages and relations between them. | ||
|
||
CMS kit packages are designed for various usage scenarios. When you visit the [CMS kit package list page](https://www.nuget.org/packages?q=Volo.CmsKit), you will see that packages have admin, public and unified versions. | ||
For example, | ||
- `Volo.CmsKit.Admin.Application`: Contains functionality required by admin websites. | ||
- `Volo.CmsKit.Public.Application`: Contains functionality required by public websites. | ||
- `Volo.CmsKit.Application` : Unified package dependent on both public and admin packages. | ||
|
||
If you want to separate admin and public website codes, you can use the admin and public packages. However, if you want to keep admin and public website codes in a shared project, you can use the unified packages to include admin and public packages. | ||
|
||
It is recommended to use the unified packages instead of adding both admin and public packages. | ||
|
||
## Feature System | ||
|
||
CMS kit uses the [global feature](https://docs.abp.io/en/abp/latest/Global-Features) system for all implemented features. You can use the global feature system to enable all features or only enabled specific features easily. | ||
|
||
To enable all features in the CMS kit, open the `GlobalFeatureConfigurator` class in the `Domain.Shared` project. | ||
|
||
```csharp | ||
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit => | ||
{ | ||
cmsKit.EnableAll(); | ||
}); | ||
``` | ||
|
||
You can only enable specific features such as pages, like below. | ||
|
||
```csharp | ||
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit => | ||
{ | ||
cmsKit.Pages.Enable(); | ||
}); | ||
``` | ||
|
||
## User interface | ||
|
||
### Menu items | ||
|
||
CMS kit module adds the following items to the "Main" menu, under the "CMS" menu item: | ||
|
||
* **Pages**: Page management page. | ||
* **Blogs**: Blog management page. | ||
* **Blog Posts**: Blog post management page. | ||
* **Tags**: Tag management page. | ||
* **Comments**: Comment management page. | ||
|
||
`CmsKitAdminMenus` class has the constants for the menu item names. | ||
|
||
### Pages | ||
|
||
### Page Management | ||
|
||
Pages page is used to manage dynamic pages in the system. | ||
|
||
![pages-page](../images/cmskit-module-pages-page.png) | ||
|
||
You can create or edit an existing page on this page. | ||
|
||
![pages-edit](../images/cmskit-module-pages-edit.png) | ||
|
||
* When you create a page, you can access the created page via `pages/{slug}` URL. | ||
|
||
### Blog Management | ||
|
||
Blogs page is used to create and manage blogs in your system. | ||
|
||
![blogs-page](../images/cmskit-module-blogs-page.png) | ||
|
||
A screenshot from the new blog creation modal: | ||
|
||
![blogs-edit](../images/cmskit-module-blogs-edit.png) | ||
|
||
#### Blog Features | ||
|
||
You can enable or disable a specific feature for blogs by clicking the features action. | ||
|
||
![blogs-feature-action](../images/cmskit-module-blogs-feature-action.png) | ||
|
||
You can select/deselect the desired features for blog posts. | ||
|
||
![features-dialog](../images/cmskit-module-features-dialog.png) | ||
|
||
### Blog Post Management | ||
|
||
When you create blogs, you can manage blog posts on this page. | ||
|
||
![blog-posts-page](../images/cmskit-module-blog-posts-page.png) | ||
|
||
You can create and edit an existing blog post on this page. If you enable specific features such as tags, you can set tags for the blog post on this page. | ||
|
||
![blog-post-edit](../images/cmskit-module-blog-post-edit.png) | ||
|
||
### Tag Management | ||
|
||
CMS Kit provides an extensible tagging mechanism to add tagging capabilities to various places. | ||
|
||
![tags-page](../images/cmskit-module-tags-page.png) | ||
|
||
You can create or edit an existing tag on this page. | ||
|
||
![tag-edit](../images/cmskit-module-tag-edit.png) | ||
|
||
### Comment Management | ||
|
||
CMS Kit provides an extensible commenting mechanism to add comments to various places. You can add comment control to anywhere you want and manage the comments. | ||
|
||
You can view and manage comments on this page. | ||
|
||
![comment-page](../images/cmskit-module-comment-page.png) | ||
|
||
You can manage and view replies on this page. | ||
|
||
![comments-detail](../images/cmskit-module-comments-detail.png) | ||
|
||
### Reactions | ||
|
||
CMS Kit provides an extensible reaction component system to allow users to send reactions to your content. Here how the reactions component looks on a sample page. | ||
|
||
![reactions](../images/cmskit-module-reactions.png) | ||
|
||
You can also customize the reaction icons shown in the reaction component. | ||
|
||
### Ratings | ||
|
||
You can use the rating component to add rating a mechanism to your content. Here how the rating component looks on a sample page. | ||
|
||
![ratings](../images/cmskit-module-ratings.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Comment System | ||
|
||
CMS kit provides a **rating** system to add comments feature to any kind of resource, like blog posts, products, etc. This section describes the details of the comments system. | ||
|
||
## Feature | ||
|
||
CMS kit uses the [global feature](https://docs.abp.io/en/abp/latest/Global-Features) 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 public website option. If you're installing the CMS kit manually or want to enable the comment feature individually, open the `GlobalFeatureConfigurator` class in the `Domain.Shared` project and place the following code to the `Configure ` method. | ||
|
||
```csharp | ||
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit => | ||
{ | ||
cmsKit.Comments.Enable(); | ||
}); | ||
``` | ||
|
||
# Options | ||
|
||
## CmsKitCommentOptions | ||
|
||
You can use the comment system to add comments to any kind of resources, like blog posts, products etc. Comment system provides a mechanism to group comment definitions by entity types. For example, if you want to use comment system for blog posts and products, you need to define two entity types named `BlogPosts` and `Product`, and add comments under these entity types. | ||
|
||
`CmsKitCommentOptions` can be configured in the domain layer, in the `ConfigureServices` method of your [module](https://docs.abp.io/en/abp/latest/Module-Development-Basics). Example: | ||
|
||
```csharp | ||
Configure<CmsKitCommentOptions>(options => | ||
{ | ||
options.EntityTypes.Add(new CommentEntityTypeDefinition("Product")); | ||
}); | ||
``` | ||
|
||
> If you're using the blog feature, the ABP framework defines an entity type for the blog feature automatically. You can easily override or remove the predefined entity types in `Configure` method like shown above. | ||
`CmsKitCommentOptions` properties: | ||
|
||
- `EntityTypes`: List of defined entity types(`CmsKitCommentOptions`) in the comment system. | ||
|
||
`CommentEntityTypeDefinition` properties: | ||
|
||
- `EntityType`: Name of the entity type. | ||
|
||
# Internals | ||
|
||
## Domain Layer | ||
|
||
#### Aggregates | ||
|
||
This module follows the [Entity Best Practices & Conventions](https://docs.abp.io/en/abp/latest/Best-Practices/Entities) guide. | ||
|
||
##### Comment | ||
|
||
A comment represents a written comment from a user. | ||
|
||
- `Comment` (aggregate root): Represents a written comment in the system. | ||
|
||
#### Repositories | ||
|
||
This module follows the [Repository Best Practices & Conventions](https://docs.abp.io/en/abp/latest/Best-Practices/Repositories) guide. | ||
|
||
Following custom repositories are defined for this feature: | ||
|
||
- `ICommentRepository` | ||
|
||
#### Domain services | ||
|
||
This module follows the [Domain Services Best Practices & Conventions](https://docs.abp.io/en/abp/latest/Best-Practices/Domain-Services) guide. | ||
|
||
##### Comment Manager | ||
|
||
`CommentManager` is used to perform some operations for the `Comment` aggregate root. | ||
|
||
### Application layer | ||
|
||
#### Application services | ||
|
||
- `CommentAdminAppService` (implements `ICommentAdminAppService`): Implements the use cases of comment management system, like listing or removing comments etc. | ||
- `CommentPublicAppService` (implements `ICommentPublicAppService`): Implements the use cases of comment management on the public websites, like listing comments, adding comments etc. | ||
|
||
### 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](https://docs.abp.io/en/abp/latest/Connection-Strings) documentation for details. | ||
|
||
#### Entity Framework Core | ||
|
||
##### Tables | ||
|
||
- CmsComments | ||
|
||
#### MongoDB | ||
|
||
##### Collections | ||
|
||
- **CmsComments** | ||
|
||
### MVC UI | ||
|
||
The comment system provides a commenting widget to allow users to send comments to resources on public websites. You can simply place the widget on a page like below. | ||
|
||
```csharp | ||
@await Component.InvokeAsync(typeof(CommentingViewComponent), new | ||
{ | ||
entityType = "entityType", | ||
entityId = "entityId" | ||
}) | ||
``` | ||
You need to specify entity type and entity ID parameters. Entity type represents the group name you specified while defining the comments in the domain module. Entity ID represents the unique identifier for the resource that users send comments to, such as blog post ID or product ID. | ||
|
||
For more information about widgets see [widgets](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Widgets) documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Rating System | ||
|
||
CMS kit provides a **rating** system to to add ratings feature to any kind of resource like blog posts, comments, etc. This section describes the details of the rating system. | ||
|
||
## Feature | ||
|
||
CMS kit uses the [global feature](https://docs.abp.io/en/abp/latest/Global-Features) 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 rating feature individually, open the `GlobalFeatureConfigurator` class in the `Domain.Shared` project and place the following code to the `Configure ` method. | ||
|
||
```csharp | ||
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit => | ||
{ | ||
cmsKit.Ratings.Enable(); | ||
}); | ||
``` | ||
|
||
# Options | ||
|
||
## CmsKitRatingOptions | ||
|
||
You can use the rating system to to add ratings to any kind of resource, like blog posts, comments, etc. The rating system provides a mechanism to group ratings by entity types. For example, if you want to use the rating system for products, you need to define an entity type named `Product` and then add ratings under the defined entity type. | ||
|
||
`CmsKitRatingOptions` can be configured in the domain layer, in the `ConfigureServices` method of your [module](https://docs.abp.io/en/abp/latest/Module-Development-Basics). Example: | ||
|
||
```csharp | ||
Configure<CmsKitRatingOptions>(options => | ||
{ | ||
options.EntityTypes.Add(new RatingEntityTypeDefinition("Product")); | ||
}); | ||
``` | ||
|
||
> If you're using the blog feature, the ABP framework defines an entity type for the blog feature automatically. You can easily override or remove the predefined entity types in `Configure` method like shown above. | ||
`CmsKitRatingOptions` properties: | ||
|
||
- `EntityTypes`: List of defined entity types(`RatingEntityTypeDefinition`) in the rating system. | ||
|
||
`RatingEntityTypeDefinition` properties: | ||
|
||
- `EntityType`: Name of the entity type. | ||
|
||
# Internals | ||
|
||
## Domain Layer | ||
|
||
#### Aggregates | ||
|
||
This module follows the [Entity Best Practices & Conventions](https://docs.abp.io/en/abp/latest/Best-Practices/Entities) guide. | ||
|
||
##### Rating | ||
|
||
A rating represents a given rating from a user. | ||
|
||
- `Rating` (aggregate root): Represents a given rating in the system. | ||
|
||
#### Repositories | ||
|
||
This module follows the [Repository Best Practices & Conventions](https://docs.abp.io/en/abp/latest/Best-Practices/Repositories) guide. | ||
|
||
Following custom repositories are defined for this feature: | ||
|
||
- `IRatingRepository` | ||
|
||
#### Domain services | ||
|
||
This module follows the [Domain Services Best Practices & Conventions](https://docs.abp.io/en/abp/latest/Best-Practices/Domain-Services) guide. | ||
|
||
##### Reaction Manager | ||
|
||
`RatingManager` is used to perform some operations for the `Rating` aggregate root. | ||
|
||
### Application layer | ||
|
||
#### Application services | ||
|
||
- `RatingPublicAppService` (implements `IRatingPublicAppService`): Implements the use cases of rating system. | ||
|
||
### 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](https://docs.abp.io/en/abp/latest/Connection-Strings) documentation for details. | ||
|
||
#### Entity Framework Core | ||
|
||
##### Tables | ||
|
||
- CmsRatings | ||
|
||
#### MongoDB | ||
|
||
##### Collections | ||
|
||
- **CmsRatings** | ||
|
||
### MVC UI | ||
|
||
The ratings system provides a rating widget to allow users send ratings to resources in public websites. You can simply place the widget on a page like below. | ||
|
||
```csharp | ||
@await Component.InvokeAsync(typeof(RatingViewComponent), new | ||
{ | ||
entityType = "entityType", | ||
entityId = "entityId" | ||
}) | ||
``` | ||
You need to specify entity type and entity ID parameters. Entity type represents the group name you specified while defining the reactions in the domain module. Entity ID represents the unique identifier for the resource that users give ratings to, such as blog post ID or product ID. | ||
|
||
For more information about widgets see [widgets](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Widgets) documentation. |
Oops, something went wrong.