@ -13,25 +13,25 @@ CMS Kit provides a widget to create a contact form on your website.
## Enabling the Contact Management System
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../framework/infrastructure/global-features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP's [Feature System](../framework/infrastructure/features.md) to disable a CMS Kit feature on runtime.
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want before starting to use them. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable or disable CMS Kit features at development time. Alternatively, you can use ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature at runtime.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable/disable CMS Kit features on development time.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable or disable CMS Kit features at development time.
## Contact Widget
The contact management system provides a contact form [widget](../../framework/ui/mvc-razor-pages/widgets.md) to create contact forms on the UI:
The contact management system allows you to create multiple contact forms. You can define a named contact widget as below:
The contact management system allows you to create multiple contact forms with different receivers. You can define a named contact widget as shown below:
```csharp
@await Component.InvokeAsync(typeof(ContactViewComponent), new
@ -40,7 +40,7 @@ The contact management system allows you to create multiple contact forms. You c
});
```
Then, you need to configure the defined contact widgets in the `ConfigureServices` method of your module class:
Then, configure the receiver for each name in the `ConfigureServices` method of your module class:
When the submitted `contactName` matches a configured entry, that entry's receiver is used. Otherwise, the module uses the receiver email address configured on the CMS settings page. The contact name is also prefixed to the email subject when it is not empty.
## Options
You can configure the `CmsKitContactOptions` to enable/disable recaptcha for contact form in the `ConfigureServices` method of your [module](../../framework/architecture/modularity/basics.md).
You can configure `CmsKitContactOptions` to enable or disable reCAPTCHA for the contact form in the `ConfigureServices` method of your [module](../../framework/architecture/modularity/basics.md).
Example:
```csharp
Configure<CmsKitContactOptions>(options =>
{
options.IsRecaptchaEnabled = true; //false by default
options.IsRecaptchaEnabled = true;
});
```
`CmsKitContactOptions` properties:
* `IsRecaptchaEnabled` (default: false): This flag enables or disables the reCaptcha for the contact form. You can set it as **true** if you want to use reCaptcha in your contact form.
* `IsRecaptchaEnabled` (default: `false`): Enables reCAPTCHA v3 validation for public contact submissions.
If you set **IsRecaptchaEnabled** as **true**, you also need to specify **SiteKey** and **SiteSecret** options for reCaptcha. To do that, add **CmsKit:Contact** section into your `appsettings.json` file:
If you set `IsRecaptchaEnabled` to `true`, also specify `SiteKey` and `SiteSecret` for reCAPTCHA. Add the `CmsKit:Contact` section to your `appsettings.json` file:
```json
{
@ -85,9 +86,9 @@ If you set **IsRecaptchaEnabled** as **true**, you also need to specify **SiteKe
}
```
## Settings
## Settings
You can configure the receiver (email address) by using the CMS tab in the settings page.
You can configure the fallback receiver email address on the CMS tab of the settings page. This setting is tenant-aware and is used when the form has no matching named receiver. Its default value is `info@mycompanyname.com`; replace it with an address that belongs to your application before deploying to production.
> You must have an [ABP Team or a higher license](https://abp.io/pricing) to use CMS Kit Pro module's features.
The CMS kit provides a **FAQ** system to allow users to create, edit and delete FAQ's. Here is a screenshot of the FAQ widget:
CMS Kit Pro provides an **FAQ** system to organize questions into groups and sections and display them on public pages. Here is a screenshot of the FAQ widget:
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP Framework's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature on runtime.
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want before starting to use them. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable or disable CMS Kit features at development time. Alternatively, you can use ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature at runtime.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable/disable CMS Kit features on development time.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable or disable CMS Kit features at development time.
## User Interface
@ -25,21 +25,21 @@ By default, CMS Kit features are disabled. Therefore, you need to enable the fea
CMS Kit module admin side adds the following items to the main menu, under the **CMS** menu item:
**FAQ's**: FAQ management page.
**FAQs**: FAQ group, section and question management page.
`CmsKitProAdminMenus` class has the constants for the menu item names.
### Pages
You can list, create, update and delete sections and their questions FAQ's on the admin side of your solution.
You can list, create, update and delete FAQ groups, sections and questions on the admin side of your solution. A group contains sections, and a section contains questions.
The FAQ system provides a FAQ [widget](../../framework/ui/mvc-razor-pages/widgets.md) for users to display FAQ's. You can place the widget on a page like below:
The FAQ system provides an FAQ [widget](../../framework/ui/mvc-razor-pages/widgets.md) for displaying FAQs. You can place the widget on a page as shown below:
```csharp
@await Component.InvokeAsync(
@ -47,30 +47,20 @@ The FAQ system provides a FAQ [widget](../../framework/ui/mvc-razor-pages/widget
new
{
groupName = "Community",
name = "Development"
sectionName = "Development"
})
```
`FaqViewComponent` parameters:
- `groupName` (optional): It allows to specify which FAQ group to show. If not specified, all groups will be shown.
- `sectionName` (optional): It is used to determine which section within the specified group will be shown. If not specified, all sections in the related group will be shown.
The FAQ system can also be used in combination with the [dynamic widget](../cms-kit/dynamic-widget.md) feature.
## Options
The FAQ system provides a mechanism to group sections by group name. For example, if you want to use the FAQ system for community and support page, you need to define two group names named Community and Support and add sections under these groups. So, before using the FAQ system, you need to define groups. For that, you can use `FaqOptions`. `FaqOptions` can be configured at the domain layer, in the `ConfigureServices` method of your [module]../../framework/architecture/modularity/basics.md).
- `groupName` (required): Specifies the FAQ group to show. Create this group on the FAQ administration page before rendering the widget.
- `sectionName` (optional): Specifies a section within the selected group. If it is not set, all sections in the group are shown.
The FAQ system can also be used in combination with the [dynamic widget](../cms-kit/dynamic-widget.md) feature.
`FaqOptions` properties:
## FAQ Groups
- `Groups`: Dictionary of defined groups in the FAQ system. The `options.SetGroups` method is a shortcut to add a new groups to this dictionary.
FAQ groups are persisted data and are managed from the FAQ administration page. Create groups such as `Community` or `Support`, then assign each section to one of those groups. Group names must be unique.
## Internals
@ -82,10 +72,11 @@ This module follows the [Entity Best Practices & Conventions](../../framework/ar
##### FAQ
A FAQ represents a generated FAQ with its questions:
An FAQ represents a generated FAQ with its questions:
- `FaqSection` (aggregate root): Represents the defined FAQ sections related to the FAQ in the system.
- `FaqQuestion` (aggregate root): Represents the defined FAQ questions with section identifier related to the FAQ in the system.
- `FaqGroup` (aggregate root): Represents a named group that contains FAQ sections.
#### Repositories
@ -95,6 +86,7 @@ The following special repositories are defined for these features:
- `IFaqSectionRepository`
- `IFaqQuestionRepository`
- `IFaqGroupRepository`
#### Domain services
@ -108,7 +100,9 @@ This module follows the [Domain Services Best Practices & Conventions](../../fra
- `FaqSectionAdminAppService` (implements `IFaqSectionAdminAppService`): Implements the use cases of FAQ section management for admin side.
- `FaqQuestionAdminAppService` (implements `IFaqQuestionAdminAppService`): Implements the use cases of FAQ question management for admin side.
- `FaqSectionPublicAppService` (implements `IFaqSectionPublicAppService`): Implements the use cases of FAQ's for public websites.
- `FaqGroupAdminAppService` (implements `IFaqGroupAdminAppService`): Implements the use cases of FAQ group management for admin side.
- `FaqSectionPublicAppService` (implements `IFaqSectionPublicAppService`): Implements the use cases of FAQs for public websites.
- `FaqGroupPublicAppService` (implements `IFaqGroupPublicAppService`): Finds FAQ groups by name for public widgets.
### Database providers
@ -116,11 +110,11 @@ This module follows the [Domain Services Best Practices & Conventions](../../fra
##### 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).
All tables/collections use the `Cms` prefix by default. Set static properties on the `AbpCmsKitDbProperties` 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.
This module uses `CmsKit` for the connection string name. If you don't define a connection string with this name, it falls back to the `Default` connection string.
See the [connection strings](../../framework/fundamentals/connection-strings.md) documentation for details.
@ -130,6 +124,7 @@ See the [connection strings](../../framework/fundamentals/connection-strings.md)
- CmsFaqSections
- CmsFaqQuestions
- CmsFaqGroups
#### MongoDB
@ -137,7 +132,4 @@ See the [connection strings](../../framework/fundamentals/connection-strings.md)
- CmsFaqSections
- CmsFaqQuestions
## Entity Extensions
Check the ["Entity Extensions" section of the CMS Kit Module documentation](index.md#entity-extensions) to see how to extend entities of the FAQ Feature of the CMS Kit Pro module.
This module extends the [open-source CMS Kit module](../cms-kit) and adds additional CMS (Content Management System) capabilities to your application.
> **This module is currently available for MVC / Razor Pages and Blazor UIs**.
The administration UI is available for MVC / Razor Pages, Angular and Blazor (Blazorise and MudBlazor). The public website widgets documented in the feature pages are MVC / Razor Pages components.
The following features are provided by the open-source CMS Kit module:
@ -30,10 +30,10 @@ The following features are provided by the CMS Kit Pro version:
* [**Newsletter**](newsletter.md) It allows users to subscribe to newsletters.
* [**Contact form**](contact-form.md) It allows users to write messages to you.
* [**URL forwarding**](URL-forwarding.md) It allows the creation of URLs that point to other pages or external websites.
* [**Poll**](poll.md) It allows to create simple polls for your visitors.
* [**URL forwarding**](url-forwarding.md) It allows the creation of URLs that point to other pages or external websites.
* [**Poll**](poll.md) Allows you to create simple polls for your visitors.
* [**Page Feedback**](page-feedback.md) It allows users to send feedback for your pages.
* [**Faq**](faq.md) system to create dynamic FAQ.
* [**FAQ**](faq.md) system to create dynamic FAQs.
Click on a feature to understand and learn how to use it. See [the module description page](https://abp.io/modules/Volo.CmsKit.Pro) for an overview of the module features.
@ -41,7 +41,7 @@ Click on a feature to understand and learn how to use it. See [the module descri
### New Solutions
CMS Kit Pro is pre-installed in [the startup templates](../../solution-templates) if you create the solution with the **public website** option. If you are using ABP CLI, you should specify the the `--with-public-website` option as shown below:
CMS Kit Pro is pre-installed in [the startup templates](../../solution-templates) if you create the solution with the **public website** option. If you are using ABP CLI, specify the `--with-public-website` option as shown below:
```bash
abp new Acme.BookStore --with-public-website
@ -49,7 +49,7 @@ abp new Acme.BookStore --with-public-website
### Existing Solutions
If you want to add the CMS kit to your existing solution, you can use the ABP CLI `add-module` command:
If you want to add CMS Kit Pro to your existing solution, you can use the ABP CLI `add-module` command:
```bash
abp add-module Volo.CmsKit.Pro
@ -77,11 +77,47 @@ Alternatively, you can enable features individually, like `cmsKit.Comments.Enabl
> If you are using Entity Framework Core, remember to add a new migration and update your database.
### Angular Administration UI
The Angular package publishes the administration routes and their menu configuration in separate entry points. Register the configuration provider in your application configuration:
```typescript
import { ApplicationConfig } from '@angular/core';
import { provideCmsKitAdminConfig } from '@abp/ng.cms-kit/admin/config';
import { provideCmsKitProAdminConfig } from '@volo/abp.ng.cms-kit-pro/admin/config';
[Module entity extension](../../framework/architecture/modularity/extending/module-entity-extensions.md) system is a **high-level** extension system that allows you to **define new properties** for existing entities of the dependent modules. It automatically **adds properties to the entity**, **database**, **HTTP API and user interface** in a single point.
The [module entity extension](../../framework/architecture/modularity/extending/module-entity-extensions.md) system allows you to define new properties for supported entities of a dependent module from a single configuration point.
To extend entities of the CMS Kit Pro module, open your `YourProjectNameModuleExtensionConfigurator` class inside of your `DomainShared` project and change the `ConfigureExtraProperties` method like shown below.
To extend entities of the CMS Kit Pro module, open your `YourProjectNameModuleExtensionConfigurator` class in the `Domain.Shared` project and change the `ConfigureExtraProperties` method as shown below.
```csharp
public static void ConfigureExtraProperties()
@ -91,49 +127,44 @@ public static void ConfigureExtraProperties()
ObjectExtensionManager.Instance.Modules()
.ConfigureCmsKitPro(cmsKitPro =>
{
cmsKitPro.ConfigurePoll(plan => // extend the Poll entity
property.Attributes.Add(new RequiredAttribute()); //adds required attribute to the defined property
property.Attributes.Add(
new StringLengthAttribute(MyConsts.MaximumDescriptionLength) {
MinimumLength = MyConsts.MinimumDescriptionLength
}
);
//...other configurations for this property
}
newsletterRecord.AddOrUpdateProperty<string>(
"NewsletterRecordDescription",
property =>
{
property.Attributes.Add(new RequiredAttribute());
property.Attributes.Add(
new StringLengthAttribute(MyConsts.MaximumDescriptionLength)
{
MinimumLength = MyConsts.MinimumDescriptionLength
}
);
}
);
});
});
});
});
}
```
* `ConfigureCmsKitPro` method is used to configure the entities of the CMS Kit Pro module.
* `cmsKit.ConfigurePoll(...)` is used to configure the **Poll** entity of the CMS Kit Pro module. You can add or update the extra properties of the **Poll** entity.
* `cmsKitPro.ConfigurePoll(...)` is used to configure the **Poll** entity of the CMS Kit Pro module. You can add or update the extra properties of the **Poll** entity.
* `cmsKit.ConfigureNewsletterRecord(...)` is used to configure the **NewsletterRecord** entity of the CMS Kit Pro module. You can add or update the extra properties of the **NewsletterRecord** entity.
* `cmsKitPro.ConfigureNewsletterRecord(...)` is used to configure the **NewsletterRecord** entity of the CMS Kit Pro module. You can add or update the extra properties of the **NewsletterRecord** entity.
* You can also set some validation rules for the property that you defined. In the above sample, `RequiredAttribute` and `StringLengthAttribute` were added for the property named **"NewsletterRecord"**.
* You can also set validation rules for the properties you define. In the example above, `RequiredAttribute` and `StringLengthAttribute` are added to the **NewsletterRecordDescription** property.
* When you define the new property, it will automatically add to **Entity**, **HTTP API** and **UI** for you.
* Once you define a property, it appears in the create and update forms of the related entity.
* New properties also appear in the data table on the related page.
* Extra properties are added to the entity and HTTP API. UI integration is entity- and UI-specific: Poll has create and update forms, while Newsletter records are read-only and expose their extra properties through the application DTOs.
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature on runtime.
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want before starting to use them. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable or disable CMS Kit features at development time. Alternatively, you can use ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature at runtime.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable/disable CMS Kit features on development time.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable or disable CMS Kit features at development time.
## User Interface
@ -29,20 +29,19 @@ By default, CMS Kit features are disabled. Therefore, you need to enable the fea
#### Newsletters
You can then view the subscribers and export the list as CSV file, in the admin side of your solution:
You can view subscribers, edit their preferences, import subscriptions from a CSV file and export the filtered list as a CSV file on the admin side of your solution:
You (and users of your public web application) can manage your email preferences and unsubscribe from newsletters by visiting the **Email Preferences page** (*/cms/newsletter/email-preferences*), in the public side of your solution:
Users can manage their email preferences and unsubscribe from newsletters on the public **Email Preferences** page at `/cms/newsletter/email-preferences`:
The newsletter subscription system provides a newsletter subscription [widget](../../framework/ui/mvc-razor-pages/widgets.md) to allow users to subscribe to a newsletter.
You can simply place the widget on a page like below:
The newsletter subscription system provides a newsletter subscription [widget](../../framework/ui/mvc-razor-pages/widgets.md) to allow users to subscribe to a newsletter. You can place the widget on a page as shown below:
```csharp
@await Component.InvokeAsync(
@ -52,10 +51,12 @@ You can simply place the widget on a page like below:
preference = "TechNewsletter",
source = "Footer",
requestAdditionalPreferencesLater = false
})
})
```
When you're adding the newsletter component, you can the specify `source` parameter to see where users subscribe to newsletters. See the options to understand the preferences.
The `preference` and `source` parameters are required. `preference` must match a registered preference. Use `source` to distinguish where subscriptions originate, such as `Footer` or `Blog`. If `requestAdditionalPreferencesLater` is `true`, the widget requests the additional subscriptions in the success dialog instead of the initial form. You can also pass `privacyPolicyConfirmation` to override the preference's configured privacy-policy text for that widget instance.
New subscriptions require email confirmation. Once confirmed, users can manage all registered preferences from `/cms/newsletter/email-preferences`; disabling every preference removes the subscription record.
## Options
@ -64,25 +65,67 @@ Before using the newsletter system, you need to define the preferences. You can
**Example:**
```csharp
options.AddPreference("TechNewsletter",
new NewsletterPreferenceDefinition(
"Daily Technology Newsletter",
privacyPolicyConfirmation: "I accept the <ahref='/privacy-policy'>Privacy Policy</a>.")
)
);
Configure<NewsletterOptions>(options =>
{
options.AddPreference(
"ProductUpdates",
new NewsletterPreferenceDefinition(
new LocalizableString(
typeof(MyProjectResource),
"Newsletter:ProductUpdates")
)
);
options.AddPreference(
"TechNewsletter",
new NewsletterPreferenceDefinition(
new LocalizableString(
typeof(MyProjectResource),
"Newsletter:TechNewsletter"),
definition: new LocalizableString(
typeof(MyProjectResource),
"Newsletter:TechNewsletterDescription"),
privacyPolicyConfirmation: new LocalizableString(
typeof(MyProjectResource),
"Newsletter:PrivacyPolicyConfirmation"),
additionalPreferences: new List<string> { "ProductUpdates" }
)
);
});
```
`NewsletterOptions` properties:
- `Preferences`: List of defined newsletter preferences (`NewsletterPreferenceDefinition`) in the newsletter system.
- `Preferences`: Dictionary of registered preference names and their `NewsletterPreferenceDefinition` values.
- `WidgetViewPath`: Default view path for all newsletter preferences.
`NewsletterPreferenceDefinition` properties:
- `Preference`: Name of the preference. We will use this field while displaying the newsletter component on the UI.
- `PrivacyPolicyConfirmation`: Privacy policy confirmation text shown in the newsletter subscription widget.
- `AdditionalPreferences`: Additional preference list that will show up after a user subscribes to the newsletter.
- `WidgetPath`: If you want to use a different newsletter widget instead of the default widget, you can specify the newsletter widget path using this field.
- `DisplayPreference`: Localizable display name of the preference.
- `Definition`: Optional localizable description shown on the email preferences page.
- `PrivacyPolicyConfirmation`: Privacy policy confirmation text for the newsletter subscription widget. The preference-level value currently reaches the widget only when the selected definition has a non-empty `AdditionalPreferences` list; otherwise the service returns before localizing this value. Pass `privacyPolicyConfirmation` when invoking the widget if you need an override that is independent of that list.
- `AdditionalPreferences`: Names of other registered preferences that participate in the additional-preference flow.
- `WidgetViewPath`: Optional Razor view path for this preference. It overrides the default `NewsletterOptions.WidgetViewPath`.
The widget uses `~/Pages/Public/Shared/Components/Newsletter/Default.cshtml` when neither view-path option is set.
The current implementation first checks whether the selected preference has a non-empty `AdditionalPreferences` list. If it does, the service collects registered preference names referenced by the `AdditionalPreferences` lists of all registered definitions, excludes the selected preference and removes duplicates. If the selected preference has no additional preferences, the widget does not offer any. Keep this global collection behavior in mind when multiple definitions reference different additional preferences.
### Email Preferences Page Options
Use `NewsletterPreferencesManagementOptions` to set the source recorded for changes made on the email preferences page and an optional privacy-policy confirmation message:
options.PrivacyPolicyConfirmation = new LocalizableString(
typeof(MyProjectResource),
"Newsletter:PrivacyPolicyConfirmation"
);
});
```
## Internals
@ -94,7 +137,7 @@ This module follows the [Entity Best Practices & Conventions](../../framework/ar
##### NewsletterRecord
A newsletter record represents a newsletter subscription for a specific email address
A newsletter record represents a newsletter subscription for a specific email address.
- `NewsletterRecord` (aggregate root): Represents a newsletter subscription in the system.
@ -127,11 +170,11 @@ This module follows the [Domain Services Best Practices & Conventions](../../fra
##### 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).
All tables/collections use the `Cms` prefix by default. Set static properties on the `AbpCmsKitDbProperties` 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.
This module uses `CmsKit` for the connection string name. If you don't define a connection string with this name, it falls back to the `Default` connection string.
See the [connection strings](../../framework/fundamentals/connection-strings.md) documentation for details.
@ -150,4 +193,4 @@ See the [connection strings](../../framework/fundamentals/connection-strings.md)
## Entity Extensions
Check the ["Entity Extensions" section of the CMS Kit Module documentation](index.md#entity-extensions) to see how to extend entities of the Newsletter Feature of the CMS Kit Pro module.
Check the ["Entity Extensions" section of the CMS Kit Module documentation](index.md#entity-extensions) to see how to extend entities of the Newsletter Feature of the CMS Kit Pro module.
@ -15,9 +15,9 @@ The CMS Kit Pro module provides a comprehensive **Page Feedback** system that en
## Enabling the Page Feedback System
All CMS Kit features are disabled bu default. Therefore, you need to enable the features you want before starting to use it. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable/disable the CMS Kit features on development time. Alternatively, you can use the ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature on runtime.
All CMS Kit features are disabled by default. Therefore, you need to enable the features you want before starting to use them. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable or disable CMS Kit features at development time. Alternatively, you can use ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature at runtime.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable/disable CMS Kit features on development time.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable or disable CMS Kit features at development time.
## User Interface
@ -27,13 +27,13 @@ The CMS Kit module admin side adds the following items to the main menu, under t
The `CmsKitProAdminMenus` class has the constants for the menu items names.
The `CmsKitProAdminMenus` class defines the menu item name constants.
### Pages
#### Page Feedbacks
You can list, view, update and delete page feedbacks in the admin side of your solution, and you can also set the email addresses to send notifications.
You can list, view, update and delete page feedback from the administration interface. You can also configure the email addresses that receive notifications.
@ -42,7 +42,16 @@ You can list, view, update and delete page feedbacks in the admin side of your s
## Page Feedback Widget
The page feedback system provides a page feedback [widget](../../framework/ui/mvc-razor-pages/widgets.md) for users to send feedback about the current page. You can place the widget on a page like the below:
The page feedback system accepts only registered entity types. Register the entity type in the domain layer before rendering its widget:
You can then place the page feedback [widget](../../framework/ui/mvc-razor-pages/widgets.md) on a page:
```csharp
@(await Component.InvokeAsync(typeof(PageFeedbackViewComponent), new PageFeedbackViewDto
@ -59,8 +68,12 @@ The page feedback system provides a page feedback [widget](../../framework/ui/mv
- `YesButtonText`: Yes button text. Used to change the default text of the yes button. Default value is `Yes`.
- `VeryHelpfulText`: Description shown with the positive feedback choice.
- `NoButtonText`: No button text. Used to change the default text of the no button. Default value is `No`.
- `NeedsImprovementText`: Description shown with the negative feedback choice.
- `UserNotePlaceholder`: User note placeholder. Used to change the default placeholder of the user note input.
- `SubmitButtonText`: Submit button text. Used to change the default text of the submit button. Default value is `Submit`.
@ -77,7 +90,7 @@ The page feedback system provides a page feedback [widget](../../framework/ui/mv
### Page Feedback Modal Widget
The page feedback system provides a page feedback modal [widget](../../framework/ui/mvc-razor-pages/widgets.md) for users to send feedback about the current page. You can place the widget on a page like the below:
The page feedback system provides a page feedback modal [widget](../../framework/ui/mvc-razor-pages/widgets.md) for users to send feedback about the current page. You can place the widget on a page as shown below:
@ -95,42 +108,38 @@ The page feedback system provides a page feedback modal [widget](../../framework
### PageFeedbackModalViewDto Properties
It inherits from the [PageFeedbackViewDto](#pagefeedbackviewdto-properties) and has the following additional properties:
`PageFeedbackModalViewDto` inherits from [PageFeedbackViewDto](#pagefeedbackviewdto-properties) and adds the following property:
- `ModalId`: Modal id. Used to set the id of the modal. Default value is `page-feedback-modal`.
The current modal component does not forward the inherited `ReverseButtons` and `HeaderVisible` values to its rendered model. These two properties work with `PageFeedbackViewComponent`, but setting them on `PageFeedbackModalViewDto` has no effect. The other inherited widget text and entity properties are forwarded by the modal component.
## Page Feedback Notification
The page feedback system sends an email notification to the configured email addresses when a user sends a feedback. You can configure the email addresses from the admin side of your solution.
The page feedback system sends an email notification to the configured email addresses when feedback includes a user note. You can configure addresses for each entity type and a default fallback from the admin side of your solution.
The CMS settings page also provides these tenant-aware behavior settings:
- **Automatically handle feedback without comments** (default: `true`): Marks new feedback as handled when no user note is provided.
- **Require comments for negative feedback** (default: `false`): When a new negative feedback record is created, rejects it if no user note is provided. This setting is not re-evaluated when an existing record's usefulness value is changed.
## Options
The page feedback system provides a mechanism to group feedbacks by entity types. For example, you can group feedbacks by pages, blog posts, etc.
`CmsKitPageFeedbackOptions` can be configured in the domain layer, in the `ConfigureServices` method of your [module](../../framework/architecture/modularity/basics.md) class.
**Example: Adding page feedback support for the post entity type**
- `EntityTypes`: A list of the defined entity types(`PageFeedbackEntityTypeDefinition`) in the page feedback system.
- `EntityTypes`: A list of the defined entity types (`PageFeedbackEntityTypeDefinition`) in the page feedback system.
`PageFeedbackEntityTypeDefinition` properties:
- `EntityType`: Name of the entity type.
- `DisplayName`: Display name of the entity type. You can use a user friendly display name to show the entity type definition on the admin website.
- `CreatePolicies`: List of policy/permission names allowing users to create tags under the entity type.
- `UpdatePolicies`: List of policy/permission names allowing users to update tags under the entity type.
- `DeletePolicies`: List of policy/permission names allowing users to delete tags under the entity type.
The earlier `Page` example registers the same entity type used by both widget examples. Only registered entity types can accept feedback or have entity-specific notification settings.
## Internals
@ -144,13 +153,13 @@ This module follows the [Entity Best Practices & Conventions](../../framework/ar
A page feedback is a feedback sent by a user about a page.
- `PageFeedback`(Aggregate Root): Represents a page feedback.
- `PageFeedback`(Aggregate Root): Represents a page feedback.
##### PageFeedbackSetting
A page feedback setting is a setting to configure the page feedback system.
- `PageFeedbackSetting`(Aggregate Root): Represents a page feedback setting.
- `PageFeedbackSetting`(Aggregate Root): Represents a page feedback setting.
#### Repositories
@ -173,8 +182,8 @@ This module follows the [Domain Services Best Practices & Conventions](../../fra
#### Application services
- `PageFeedbackAdminAppService`(implements `IPageFeedbackAdminAppService`): Used to manage page feedbacks in the admin side of your solution.
- `PageFeedbackPublicAppService`(implements `IPageFeedbackPublicAppService`): Used to manage page feedbacks in the public side of your solution.
- `PageFeedbackAdminAppService`(implements `IPageFeedbackAdminAppService`): Manages page feedback from the administration interface.
- `PageFeedbackPublicAppService`(implements `IPageFeedbackPublicAppService`): Implements the public page feedback use cases.
### Database providers
@ -182,11 +191,11 @@ This module follows the [Domain Services Best Practices & Conventions](../../fra
##### Table / collection prefix & schema
All tables/collections use the `Cms` prefix by default. Set static properties in the `CmsKitDbProperties` class if you need to change the table prefix or set a schema name (if supported by your database provider).
All tables/collections use the `Cms` prefix by default. Set static properties on the `AbpCmsKitDbProperties` 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.
This module uses `CmsKit` for the connection string name. If you don't define a connection string with this name, it falls back to the `Default` connection string.
See the [connection strings](../../framework/fundamentals/connection-strings.md) documentation for details.
@ -203,7 +212,3 @@ See the [connection strings](../../framework/fundamentals/connection-strings.md)
- **CmsPageFeedbacks**
- **CmsPageFeedbackSettings**
## Entity Extensions
Check the ["Entity Extensions" section of the CMS Kit Module documentation](index.md#entity-extensions) to see how to extend entities of the Poll Feature of the CMS Kit Pro module.
@ -15,9 +15,9 @@ CMS Kit provides a **poll** system to allow users to create, edit and delete pol
## Enabling the Poll System
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature on runtime.
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want before starting to use them. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable or disable CMS Kit features at development time. Alternatively, you can use ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature at runtime.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable/disable CMS Kit features on development time.
> Check the ["How to Install" section of the CMS Kit Module documentation](index.md#how-to-install) to see how to enable or disable CMS Kit features at development time.
## User Interface
@ -41,7 +41,7 @@ You can list, create, update and delete polls on the admin side of your solution
## Poll Widget
The poll system provides a poll [widget](../../framework/ui/mvc-razor-pages/widgets.md) for users to vote and show the result. You can place the widget on a page like the below:
The poll system provides a poll [widget](../../framework/ui/mvc-razor-pages/widgets.md) for users to vote and view the result. You can place the widget on a page as shown below:
```csharp
@await Component.InvokeAsync(
@ -49,9 +49,26 @@ The poll system provides a poll [widget](../../framework/ui/mvc-razor-pages/widg
new
{
widgetName = "my-poll-1"
})
```
`PollViewComponent` selects a poll assigned to `widgetName` through the available-widget lookup. The repository returns a poll when either its voting window is open (`StartDate` has passed and `EndDate` has not passed) or its `ResultShowingEndDate` has not passed. The component then prevents rendering before `StartDate` and after `ResultShowingEndDate`, when that value is set. Consequently, the named widget can remain visible after `EndDate` during the result-showing period. The widget name must first be registered with `CmsKitPollingOptions`, and polls are assigned to widget names from the administration page.
To render one specific poll without registering a widget name, use its unique code:
```csharp
@await Component.InvokeAsync(
typeof(PollByCodeViewComponent),
new
{
code = "developer-survey"
})
```
`PollByCodeViewComponent` performs a direct lookup by code. It does not use the named widget's repository availability condition or component date checks, so it can render a poll before `StartDate` or after `ResultShowingEndDate`. Use it only when the hosting page applies the required availability rules.
Submitting a vote requires an authenticated user. The public vote service currently does not enforce the poll's start date, end date or result-showing end date on the server, so the host must prevent submissions outside the intended voting period. A user can submit only once for a poll; the poll's **Allow multiple vote** option controls whether that single submission can contain multiple options.
## Options
Before using the poll system, you need to define the widgets. You can use the `CmsKitPollingOptions`. `CmsKitPollingOptions` can be configured in the domain layer, in the `ConfigureServices` method of your [module](../../framework/architecture/modularity/basics.md).
@ -60,14 +77,14 @@ Before using the poll system, you need to define the widgets. You can use the `C
```csharp
Configure<CmsKitPollingOptions>(options =>
{
options.AddWidget("my-poll-1");
});
{
options.AddWidget("my-poll-1");
});
```
`CmsKitPollingOptions` properties:
- `WidgetNames`: List of defined widgets in the poll system. `options.AddWidget` method was a shortcut to add a new widget to this list.
- `WidgetNames`: List of defined widget names in the poll system. Use `options.AddWidget` to add a unique name; adding the same name twice throws an exception.
## Internals
@ -79,14 +96,14 @@ This module follows the [Entity Best Practices & Conventions](../../framework/ar
##### Poll
A poll represents a created poll with its options:
A poll represents a created poll with its options:
- `Poll` (aggregate root): Represents a poll by including the options in the system.
- `PollOption` (entity): Represents the defined poll options related to the poll in the system.
##### PollUserVote
A poll user vote represents voted poll from a user:
A poll user vote represents a user's vote in a poll:
- `PollUserVote` (aggregate root): Represents poll user votes in the system.
@ -120,11 +137,11 @@ This module follows the [Domain Services Best Practices & Conventions](../../fra
##### 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).
All tables/collections use the `Cms` prefix by default. Set static properties on the `AbpCmsKitDbProperties` 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.
This module uses `CmsKit` for the connection string name. If you don't define a connection string with this name, it falls back to the `Default` connection string.
See the [connection strings](../../framework/fundamentals/connection-strings.md) documentation for details.
@ -145,4 +162,4 @@ See the [connection strings](../../framework/fundamentals/connection-strings.md)
## Entity Extensions
Check the ["Entity Extensions" section of the CMS Kit Module documentation](index.md#entity-extensions) to see how to extend entities of the Poll Feature of the CMS Kit Pro module.
Check the ["Entity Extensions" section of the CMS Kit Module documentation](index.md#entity-extensions) to see how to extend entities of the Poll Feature of the CMS Kit Pro module.
@ -13,23 +13,32 @@ CMS Kit provides a **URL forwarding** system to create URLs that redirect to oth
## Enabling the URL Forwarding System
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature on runtime.
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want before starting to use them. You can use the [Global Feature](../../framework/infrastructure/global-features.md) system to enable or disable CMS Kit features at development time. Alternatively, you can use ABP's [Feature System](../../framework/infrastructure/features.md) to disable a CMS Kit feature at runtime.
In addition to enabling [Url Shorting global feature](index.md), you need to add `UrlShortingMiddleware` to your final application.
In addition to enabling the [URL Forwarding global feature](index.md#how-to-install), add `UrlShortingMiddleware` to the final web application. Register it before middleware that may produce a `404 Not Found` response so it can evaluate unmatched request paths after the rest of the pipeline runs.
```csharp
using Volo.CmsKit.Pro.Public.Web.Middlewares;
.
.
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseMiddleware<UrlShortingMiddleware>();
.
.
public override void OnApplicationInitialization(
ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseMiddleware<UrlShortingMiddleware>();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseConfiguredEndpoints();
}
```
This example focuses on the relative middleware order. Keep the other middleware required by your application in the pipeline.
The middleware looks up the decoded request path and query string when the downstream pipeline returns `404`. Matching exact or regular-expression rules return a permanent redirect. Same-host relative targets must start with `/`, for example `/products/current`; the middleware expands them using the current request scheme and host. Absolute targets are used as absolute destinations.
- `PreventRegexLoop` (default: `true`): Adds and checks a tracking query-string value when a regular-expression rule redirects to the same host.
- `TrackingQueryStringParameter` (default: `__redirect`): Name of that tracking query-string parameter.
- `OnConflict`: Selects a rule when more than one regular expression matches. The default selects the first matching rule.
## Internals
## Domain Layer
### Domain Layer
#### Aggregates
@ -91,11 +124,11 @@ Following custom repositories are defined for this feature:
##### 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).
All tables/collections use the `Cms` prefix by default. Set static properties on the `AbpCmsKitDbProperties` 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.
This module uses `CmsKit` for the connection string name. If you don't define a connection string with this name, it falls back to the `Default` connection string.
See the [connection strings](../../framework/fundamentals/connection-strings.md) documentation for details.