How to add TalkAbout to an existing cloudscribe site

This page documents the steps required to manually install the TalkAbout system (Comments and Forum) into an existing cloudscribe solution.

Overview

TalkAbout provides two main features:

  1. Comments System - For blog posts and pages
  2. Forum System - Full-featured discussion forums

Prerequisites

  • An existing cloudscribe solution (ASP.NET Core 8.0)
  • Access to modify project files and configuration
  • Database access (MSSQL in this example)

Step 1: Add NuGet Package References

Add the following package references to your .csproj file in the <ItemGroup Label="Package References"> section:

<!-- TalkAbout Comments System -->
<PackageReference Include="cloudscribe.TalkAbout.Web" Version="8.6.*" />
<PackageReference Include="cloudscribe.TalkAbout.Comments.Integration.CloudscribeCore" Version="8.6.*" />
<PackageReference Include="cloudscribe.TalkAbout.Web.Bootstrap5" Version="8.6.*" />
<PackageReference Include="cloudscribe.TalkAbout.Storage.EFCore.MSSQL" Version="8.6.*" />
<PackageReference Include="cloudscribe.TalkAbout.Integration.CloudscribeCore" Version="8.6.*" />

<!-- TalkAbout Forum System -->
<PackageReference Include="cloudscribe.TalkAbout.Forum.Web" Version="8.6.*" />
<PackageReference Include="cloudscribe.TalkAbout.Forum.Web.Bootstrap5" Version="8.6.*" />
<PackageReference Include="cloudscribe.TalkAbout.Forum.Storage.EFCore.MSSQL" Version="8.6.*" />

Location in file: Add these after the existing cloudscribe packages (around line 75 in the reference project).

Note: Adjust the Version to match your cloudscribe version. If using a different database provider (PostgreSQL, MySQL, SQLite), replace the MSSQL storage packages accordingly.


Step 2: Update Config/CloudscribeFeatures.cs

2.1 Add Database Storage Configuration

In the SetupDataStorage method, add the following lines before the QueryToolEFStorageMSSQL line:

// Add after DynamicPolicyEFStorageMSSQL and before QueryToolEFStorageMSSQL

services.AddCommentStorageMSSQL(connectionString);

services.AddForumStorageMSSQL(connectionString);

Location: Around line 36-38 in CloudscribeFeatures.cs

2.2 Add Service Registration

In the SetupCloudscribeFeatures method, add the following lines after the DynamicPolicy configuration and before the QueryTool line:

// Add after AddDynamicAuthorizationMvc and before AddScoped<IQueryTool>

services.AddTalkAboutCloudscribeIntegration(config);


services.AddTalkAboutForumServices(config)
    .AddTalkAboutForumNotificationServices(config);

services.AddTalkAboutCommentsCloudscribeIntegration(config);
services.AddTalkAboutServices(config)
    .AddTalkAboutNotificationServices(config);

Location: Around line 68-78 in CloudscribeFeatures.cs

Important: Maintain the order shown above for proper dependency registration.


Step 3: Update Program.cs

In the EnsureDataStorageIsReady method, add database initialization calls after DynamicPolicyEFCore and before QueryToolStartup:

// Add after DynamicPolicyEFCore.InitializeDatabaseAsync

CommentsDatabase.InitializeDatabaseAsync(scopedServices).Wait();
ForumDatabase.InitializeDatabaseAsync(scopedServices).Wait();

// Before QueryToolStartup.InitializeDatabaseAsync

Location: Around line 57-58 in Program.cs

Important: These lines create the necessary database tables for TalkAbout on first run.


Step 4: Update Config/RoutingAndMvc.cs

Important: Add Forum Routes in Two Locations

You need to add the forum routes call in TWO places in this file - once for traditional MVC routing and once for endpoint routing. Missing either location may cause issues.

4.1 Traditional MVC Routing (UseCustomRoutes for IRouteBuilder)

In the first UseCustomRoutes method (that takes IRouteBuilder), add the forum routes between the error handler and contact routes:

routes.MapRoute(
    name: "errorhandler",
    template: "oops/error/{statusCode?}",
    defaults: new { controller = "Oops", action = "Error" }
    );

// ADD THIS LINE HERE:
routes.AddForumRoutes(new cloudscribe.Core.Web.Components.SiteFolderRouteConstraint());

routes.MapRoute(
    name: "contact",
    template: "contact",
    defaults: new { controller = "Contact", action = "Index" }
    );

Location: Around line 110 in RoutingAndMvc.cs

Note: This location (between error handler and contact) matches the pattern used in the reference implementation and keeps forum routes logically grouped with other feature routes.

4.2 Endpoint Routing (UseCustomRoutes for IEndpointRouteBuilder)

Make the same change in the second UseCustomRoutes method (that takes IEndpointRouteBuilder):

routes.MapControllerRoute(
    name: "errorhandler",
    pattern: "oops/error/{statusCode?}",
    defaults: new { controller = "Oops", action = "Error" }
    );

// ADD THIS LINE HERE:
routes.AddForumRoutes(new cloudscribe.Core.Web.Components.SiteFolderRouteConstraint());

routes.MapControllerRoute(
    name: "contact",
    pattern: "contact",
    defaults: new { controller = "Contact", action = "Index" }
    );

Location: Around line 278 in RoutingAndMvc.cs

Important: You must add the line in BOTH overloads of UseCustomRoutes. The endpoint routing version is currently commented out in Startup.cs but may be used in future versions.

Why This Location?

The forum routes are placed between error handler and contact routes because:

  • This matches the pattern used in the reference cloudscribe with TalkAbout installation
  • It keeps forum routes logically separated from content routes (blog and page)
  • It ensures forum routes are evaluated at an appropriate priority level

The routing flow is:

  1. Blog routes (lines 15-21) - Handle blog-specific URLs like /blog/*
  2. Static files and file manager routes
  3. Folder-specific routes (if using multi-tenancy)
  4. Error handler route
  5. Forum routes ← Added here
  6. Contact and other feature routes
  7. API routes
  8. Default controller routes
  9. Page routes (lines 162-163) - Catch-all for page content URLs

Step 5: Update appsettings.json

5.1 Add Summernote Configuration for Comments

Add the following configuration section after the PolicyManagementOptions section:

"SummernoteOptions_TalkaboutComments": {
    "CustomConfigPath": "/talk/js/summernote-talkabout-comments-config.json",
    "CustomToolbarConfigPath": "/talk/js/summernote-talkabout-comments-toolbar-config.json",
    "FileBrowseUrl": "",
    "ImageBrowseUrl": "",
    "VideoBrowseUrl": "",
    "AudioBrowseUrl": "",
    "DropFileUrl": "",
    "CropFileUrl": "",
    "LanguageCode": ""
},

Location: Around line 46 in appsettings.json (after line 43, before SmtpOptions)

Note: This configuration is for the rich text editor used in comments.

5.2 Update ContentSettingsUIConfig

CHANGE the ContentSettingsUIConfig section to show comment settings:

"ContentSettingsUIConfig": {
    "ShowCommentSettings": true,
    "ShowDefaultContentType": false
},

Location: Around line 153-155 in appsettings.json

Change: Set "ShowCommentSettings": true (was false or missing in vanilla install)


Step 6: Add Required View Files

Why View Files Are Required

TalkAbout requires specific view files to integrate comments into blog posts and pages. These files cannot be reliably delivered via NuGet packages because they override views that already exist in cloudscribe.SimpleContent.CompiledViews.Bootstrap5.

The Problem with NuGet Delivery:

When multiple NuGet packages contain compiled views with the same path (e.g., Views/Blog/CommentWrapperPartial.cshtml), ASP.NET Core's view resolution becomes unpredictable:

  • You can't control which assembly's view gets loaded
  • Different view engines might prioritize differently
  • Build order might affect which view "wins"
  • No guaranteed override mechanism exists for compiled views

The Solution:

Views in your project's /Views/ folder always take precedence over compiled views in NuGet packages. This is a well-defined behavior in ASP.NET Core's view resolution system.

By placing these views in your project:

  • ✅ Your views reliably override SimpleContent's default comment views
  • ✅ No NuGet package conflicts
  • ✅ You can customize the comment rendering if needed
  • ✅ Clear, explicit integration

What These Files Do:

  • CommentWrapperPartial.cshtml (Blog and Page) - Replaces SimpleContent's built-in basic comment system with TalkAbout's knockout.js-based comment UI
  • PageScriptsPartial.cshtml - Overrides SimpleContent's version to add comment JavaScript includes
  • EditCommentsEnabledPartial.cshtml - Adds UI for enabling/disabling comments (new feature not in SimpleContent)
  • Shared partials - TalkAbout-specific components that don't override anything

How to Obtain the View Files

The recommended approach is to create a reference installation using the cloudscribe project template:

  1. Create a new cloudscribe project using the Visual Studio template or CLI
    • When prompted, select TalkAbout for installation
    • Choose Bootstrap 5 for the theme
    • Select your database provider (should match your existing project)
  2. Build the reference project to ensure it's working
  3. Copy the view files from the reference project to your existing project:

    Copy these directories:

    ReferenceProject/Views/Blog/     → YourProject/Views/Blog/
    ReferenceProject/Views/Page/     → YourProject/Views/Page/

    Copy these specific files from ReferenceProject/Views/Shared/ to YourProject/Views/Shared/:

    • CommentScriptsPartial.cshtml
    • CommentStylePartial.cshtml
    • TalkAboutCoreImageModalContent.cshtml
    • TalkAboutImageModalContent.cshtml

    Note: Do NOT copy _ViewImports.cshtml or _ViewStart.cshtml - those already exist in your project and contain project-specific configuration.

Complete List of Required Files

Views/Blog/ (create this directory if it doesn't exist)

  • CommentWrapperPartial.cshtml

Views/Page/ (may already exist with other customizations)

  • CommentWrapperPartial.cshtml
  • EditCommentsEnabledPartial.cshtml
  • EditWithTemplateCommentsEnabledPartial.cshtml
  • PageScriptsPartial.cshtml

Views/Shared/ (add to your existing Shared folder)

  • CommentScriptsPartial.cshtml
  • CommentStylePartial.cshtml
  • TalkAboutCoreImageModalContent.cshtml
  • TalkAboutImageModalContent.cshtml

Total: 9 view files across 3 directories

Alternative: Manual Creation

If you cannot create a reference project, you can find these view files in:

  • The cloudscribe.TalkAbout source repository: src/sourceDev.WebApp/Views/
  • Any existing cloudscribe installation that has TalkAbout installed

However, using the template is recommended as it ensures you get the correct versions for your cloudscribe/TalkAbout version.


Step 7: Update navigation.xml

7.1 Add Forum Navigation (Public-Facing)

Add the Forum navigation section after the opening <Children> tag of the Home node and before the Contact node:

<Children>
<!-- ADD FORUM NAVIGATION HERE -->
<NavNode key="ForumIndex"
         controller="Forum"
         action="Index"
         text="Forum"
         authorizationPolicy="ForumViewPolicy"
         componentVisibility=""
         >
   <Children>

     <NavNode key="ForumSettings"
                         controller="Forum"
                         action="Config"
                         text="Configuration"
                         preservedRouteParameters=""
                         iconCssClass="fas fa-cog fa-fw"
                         componentVisibility="breadcrumbs,appmenu"
                         authorizationPolicy="ForumAdminPolicy">
       <Children></Children>
     </NavNode>

     <NavNode key="ForumTags"
                controller="Forum"
                action="Tags"
                text="Tags"
                preservedRouteParameters=""
                iconCssClass="fas fa-tags fa-fw"
                componentVisibility="breadcrumbs,appmenu"
                authorizationPolicy="ForumViewPolicy">
       <Children></Children>
     </NavNode>

     <NavNode key="ForumThread"
           controller="Forum"
           action="Thread"
           text="Thread"
           authorizationPolicy="ForumViewPolicy"
           componentVisibility="breadcrumbs"
           >
       <Children></Children>
     </NavNode>
     <NavNode key="ForumNewThread"
           controller="Forum"
           action="Ask"
           text="Ask a question"
           authorizationPolicy="ForumPostPolicy"
           componentVisibility="breadcrumbs"
           >
       <Children></Children>
     </NavNode>

   </Children>
 </NavNode>

<!-- EXISTING CONTACT NODE FOLLOWS -->
    <NavNode key="Contact"

Location: After line 8 in navigation.xml (between <Children> and Contact node)

7.2 Add Comment System Settings (Admin Menu)

Add the Comment System Settings node in the Administration section, after the ContentHistory node and before the LoginPageInfo node:

     </NavNode>
 </NavNode>

<!-- ADD COMMENT SYSTEM SETTINGS HERE -->
<NavNode key="CommentSystemSettings"
                     controller="Talk"
                     action="Config"
                     text="Comment System Settings"
                     preservedRouteParameters=""
                     iconCssClass="fas fa-cog fa-fw"
                     componentVisibility="breadcrumbs,childtree,parenttree"
                     authorizationPolicy="CommentAdminPolicy">
           <Children></Children>
         </NavNode>

<!-- EXISTING LOGINPAGEINFO NODE FOLLOWS -->
       <NavNode key="LoginPageInfo"

Location: Around line 480-487 in navigation.xml (after ContentHistory, before LoginPageInfo)

Important: The position in the admin menu determines where it appears in the UI. Place it logically near other content-related settings.


Step 8: No Changes Required

The following files require NO CHANGES when installing TalkAbout:

  • Startup.cs - No modifications needed
  • Config/Authorization.cs - No modifications needed (policies are managed dynamically)
  • Config/DataProtection.cs - No modifications needed
  • Config/Localization.cs - No modifications needed

Step 9: Restore and Build

After making all the above changes:

  1. Restore NuGet packages:
    dotnet restore
  2. Build the solution:
    dotnet build
  3. Run database migrations (on first run, the database initialization code will create the necessary tables)

Step 10: Configure TalkAbout Authorization Policies

After the first run, TalkAbout will create the following authorization policies automatically (due to AutoCreateMissingPolicies: true in appsettings.json):

  • ForumViewPolicy - Already configured in appsettings.json as allow anonymous
  • ForumPostPolicy - Already configured in appsettings.json for authenticated users
  • ForumAdminPolicy - Automatically created
  • CommentAdminPolicy - Automatically created

You can manage these policies through the UI at:
Administration → Authorization Policies
(Assuming you have the cloudscribe 'Dynamic Authorization Policies' component installed - which we recommend that you do).

Recommended Policy Configuration

Via the UI, set the following policies:

  1. ForumViewPolicy: Allow Anonymous (already configured)
  2. ForumPostPolicy: Require Authenticated User (already configured)
  3. ForumAdminPolicy: Require Role "Administrators"
  4. CommentAdminPolicy: Require Role "Administrators"

Verification Checklist

After installation, verify the following:

  • Solution builds without errors
  • Application starts without errors
  • Database tables created:
    • talk_Comment
    • talk_CommentThread
    • forum_Post
    • forum_Thread
    • (and related tables)
  • Forum link appears in main navigation
  • Can access forum at /forum
  • "Comment System Settings" appears in admin menu
  • Authorization policies created in Policy Management
  • Comments appear on blog posts when enabled
  • Comments appear on pages when enabled

Database Providers

This guide uses MSSQL. For other database providers, replace the storage packages:

PostgreSQL

<PackageReference Include="cloudscribe.TalkAbout.Storage.EFCore.PostgreSql" Version="8.6.*" />
<PackageReference Include="cloudscribe.TalkAbout.Forum.Storage.EFCore.PostgreSql" Version="8.6.*" />

And in CloudscribeFeatures.cs:

services.AddCommentStoragePostgreSql(connectionString);
services.AddForumStoragePostgreSql(connectionString);

MySQL

<PackageReference Include="cloudscribe.TalkAbout.Storage.EFCore.MySQL" Version="8.6.*" />
<PackageReference Include="cloudscribe.TalkAbout.Forum.Storage.EFCore.MySQL" Version="8.6.*" />

And in CloudscribeFeatures.cs:

services.AddCommentStorageMySql(connectionString);
services.AddForumStorageMySql(connectionString);

Troubleshooting

Build Errors

Problem: Package not found errors
Solution: Ensure you have the correct NuGet feed configured and version numbers match your cloudscribe version

Runtime Errors

Problem: Database tables not created
Solution: Check that database initialization calls are added to Program.cs

Problem: 404 on forum routes
Solution: Verify forum routes are added in RoutingAndMvc.cs. Check BOTH method overloads (IRouteBuilder and IEndpointRouteBuilder)

Problem: Authorization errors
Solution: Check that policies are configured in Administration → Authorization Policies

Problem: Blogs or other content not working after TalkAbout installation
Solution:

  1. Check for syntax errors in RoutingAndMvc.cs
  2. Verify AddForumRoutes() was added to BOTH overloads of UseCustomRoutes
  3. Ensure the line is placed between error handler and contact routes in both locations
  4. Review the application logs for specific errors
  5. Verify all NuGet packages restored successfully

Problem: Comments not appearing on blog posts or pages
Solution:

  1. Verify all 9 view files were copied to your project
  2. Check that you didn't accidentally copy _ViewImports.cshtml (which would break namespaces)
  3. Ensure ShowCommentSettings is set to true in appsettings.json
  4. Enable comments on individual blog posts/pages via the edit screen

Summary of Changes

File Changes Required
.csproj Add 8 NuGet package references
Config/CloudscribeFeatures.cs Add database storage (2 lines) and services (6 lines)
Program.cs Add database initialization (2 lines)
Config/RoutingAndMvc.cs Add forum routes (1 line in 2 method overloads)
appsettings.json Add SummernoteOptions section, update ContentSettingsUIConfig
Views/ folders Add 9 view files for TalkAbout integration
navigation.xml Add forum navigation node and admin menu item
Startup.cs No changes
Config/Authorization.cs No changes

Common Installation Mistakes to Avoid

  1. Forgetting the second location - AddForumRoutes() should be added to BOTH UseCustomRoutes method overloads
  2. Syntax errors - Double-check parentheses, semicolons, and line endings
  3. Package version mismatch - Ensure all TalkAbout packages use the same version number (e.g., all 8.6.*)
  4. Missing database initialization - Without the CommentsDatabase and ForumDatabase init calls, tables won't be created
  5. Not restarting after changes - Configuration and routing changes require an application restart
  6. Missing view files - Without the 9 required view files, comments will not appear on blog posts or pages
  7. Copying _ViewImports.cshtml - Don't copy this file; it contains project-specific namespaces

Document Version: 2.2
Last Updated: 2026-01-13
Based on: cloudscribe 8.6.x with .NET 8.0
Added view files documentation and explanation of NuGet override conflicts