@ -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)
|
||||
|
@ -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.
|
@ -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.
|
@ -0,0 +1,128 @@
|
||||
# Reaction System
|
||||
|
||||
CMS kit provides a **reaction** system to add reactions feature to any kind of resource, like blog posts or comments. This section describes the details of the reaction 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 reaction 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.Reactions.Enable();
|
||||
});
|
||||
```
|
||||
|
||||
# Options
|
||||
|
||||
## CmsKitReactionOptions
|
||||
|
||||
You can use the reaction system to to add reactions feature to any kind of resource, like blog posts or comments, etc. The reaction system provides a mechanism to group reactions by entity types. For example, if you want to use the reaction system for products, you need to define an entity type named `Product`, and then add reactions under the defined entity type.
|
||||
|
||||
`CmsKitReactionOptions` 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<CmsKitReactionOptions>(options =>
|
||||
{
|
||||
options.EntityTypes.Add(
|
||||
new ReactionEntityTypeDefinition(
|
||||
"Product",
|
||||
reactions: new[]
|
||||
{
|
||||
new ReactionDefinition(StandardReactions.Smile),
|
||||
new ReactionDefinition(StandardReactions.ThumbsUp),
|
||||
new ReactionDefinition(StandardReactions.ThumbsDown),
|
||||
new ReactionDefinition(StandardReactions.Confused),
|
||||
new ReactionDefinition(StandardReactions.Eyes),
|
||||
new ReactionDefinition(StandardReactions.Heart)
|
||||
}));
|
||||
});
|
||||
```
|
||||
|
||||
> If you're using the comment or blog features, the ABP framework defines predefined reactions for these features automatically. You can easily override or remove the predefined reactions in `Configure` method like shown above.
|
||||
|
||||
`CmsKitReactionOptions` properties:
|
||||
|
||||
- `EntityTypes`: List of defined entity types(`CmsKitReactionOptions`) in the reaction system.
|
||||
|
||||
`ReactionEntityTypeDefinition` properties:asdas
|
||||
|
||||
- `EntityType`: Name of the entity type.
|
||||
- `Reactions`: List of defined reactions(`ReactionDefinition`) in 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.
|
||||
|
||||
##### UserReaction
|
||||
|
||||
A user reaction represents a given reaction from a user.
|
||||
|
||||
- `UserReaction` (aggregate root): Represents a given reaction 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:
|
||||
|
||||
- `IUserReactionRepository`
|
||||
|
||||
#### 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
|
||||
|
||||
`ReactionManager` is used to perform some operations for the `UserReaction` aggregate root.
|
||||
|
||||
### Application layer
|
||||
|
||||
#### Application services
|
||||
|
||||
- `ReactionPublicAppService` (implements `IReactionPublicAppService`): Implements the use cases of reaction 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
|
||||
|
||||
- CmsUserReactions
|
||||
|
||||
#### MongoDB
|
||||
|
||||
##### Collections
|
||||
|
||||
- **CmsUserReactions**
|
||||
|
||||
### MVC UI
|
||||
|
||||
The reaction system provides a reaction widget to allow users to send reactions to resources on public websites. You can place the widget on a page like below.
|
||||
|
||||
```csharp
|
||||
@await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), 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 reactions 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.
|
@ -0,0 +1,135 @@
|
||||
# Tag Management
|
||||
|
||||
CMS kit provides a **tag** system to tag any kind of resources, like blog posts. This section describes the details of the tag 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 tag management 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.Tags.Enable();
|
||||
});
|
||||
```
|
||||
|
||||
# Options
|
||||
|
||||
## CmsKitTagOptions
|
||||
|
||||
You can use the tag system to tag any kind of resources, like blog posts, products, etc. The tag system provides a mechanism to group tags by entity types. For example, if you want to use the tag system for blog posts and products, you need to define two entity types named `BlogPosts` and `Product` and add tags under these entity types.
|
||||
|
||||
`CmsKitTagOptions` 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<CmsKitTagOptions>(options =>
|
||||
{
|
||||
options.EntityTypes.Add(new TagEntityTypeDefiniton("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.
|
||||
|
||||
`CmsKitTagOptions` properties:
|
||||
|
||||
- `EntityTypes`: List of defined entity types(`TagEntityTypeDefiniton`) in the tag system.
|
||||
|
||||
`TagEntityTypeDefiniton` properties:
|
||||
|
||||
- `EntityType`: Name of the entity type.
|
||||
- `DisplayName`: Display name of the entity type. You can use a user friendly display name to show entity type definition on the admin website.
|
||||
- `CreatePolicies`: List of policy names allowing users to create tags under the entity type.
|
||||
- `UpdatePolicies`: List of policy names allowing users to update tags under the entity type.
|
||||
- `DeletePolicies`: List of policy names allowing users to delete tags under 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.
|
||||
|
||||
##### Tag
|
||||
|
||||
A tag represents a tag under the entity type.
|
||||
|
||||
- `Tag` (aggregate root): Represents a tag in the system.
|
||||
|
||||
##### EntityTag
|
||||
|
||||
An entity tag represents a connection between the tag and the tagged entity.
|
||||
|
||||
- `EntityTag`(entity): Represents a connection between the tag and the tagged entity.
|
||||
|
||||
#### 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:
|
||||
|
||||
- `ITagRepository`
|
||||
- `IEntityTagRepository`
|
||||
|
||||
#### Domain services
|
||||
|
||||
This module follows the [Domain Services Best Practices & Conventions](https://docs.abp.io/en/abp/latest/Best-Practices/Domain-Services) guide.
|
||||
|
||||
##### Tag Manager
|
||||
|
||||
`TagManager` is used to perform some operations for the `Tag` aggregate root.
|
||||
|
||||
##### Entity Tag Manager
|
||||
|
||||
`EntityTagManager` is used to perform some operations for the `EntityTag` entity.
|
||||
|
||||
### Application layer
|
||||
|
||||
#### Application services
|
||||
|
||||
- `TagAdminAppService` (implements `ITagAdminAppService`): Implements the use cases of tag management.
|
||||
- `EntityTagAdminAppService` (implements `IEntityTagAdminAppService`): Implements the use cases of entity tag relationship.
|
||||
- `TagAppService` (implements `ITagAppService`): Implements the use cases of entity tag relationship for 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](https://docs.abp.io/en/abp/latest/Connection-Strings) documentation for details.
|
||||
|
||||
#### Entity Framework Core
|
||||
|
||||
##### Tables
|
||||
|
||||
- CmsTags
|
||||
- CmsEntityTags
|
||||
- CmsTags
|
||||
|
||||
#### MongoDB
|
||||
|
||||
##### Collections
|
||||
|
||||
- **CmsTags**
|
||||
- **CmsEntityTags**
|
||||
|
||||
### MVC UI
|
||||
|
||||
The tag system provides a tag widget to display associated tags of the resource on public websites. You can simply place the widget on a page like below.
|
||||
|
||||
```csharp
|
||||
@await Component.InvokeAsync(typeof(TagViewComponent), new
|
||||
{
|
||||
entityType = "entityType",
|
||||
entityId = "entityId"
|
||||
})
|
||||
```
|
||||
|
||||
For more information about widgets see [widgets](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Widgets) documentation.
|
After Width: | Height: | Size: 134 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 25 KiB |