-
-
-
Dec 16, 2025 @ 11:39 - last edited last month
This is a new post in a Forum, when the title is set, the post will get a proper name.
The Forums provides it's own membership authentication, although if you already have one then you can use that by setting the
MemberTypeAliasin appsettings.Posts are ordered by date, and you can make posts sticky in the backoffice by setting the stickyness value, the higher the value the stickier the post.
Posts are stored as content nodes in Umbraco, so you can go in and see what's going on.
Posts are created by a SurfaceController, which checks permissions and fires notifications before and after a post is created
ForumPostBeforeSaveNotification,ForumPostAfterSaveNotification, so if you want you can add extra checks to the posts ( for things like flood control etc.)To speed stuff up, there is a Cache helper which works out the latest posts and post counts.
The Forum uses ViewComponents for most of it's HTML renderring, although these are contained in the RCL it is possible to override them locally if required.
Reusable Razor UI in class libraries with ASP.NET Core | Microsoft Learn
-
Dec 21, 2025 @ 00:20 - last edited last month
Example NotificationHandler for implementing FloodControl.
public class FloodControl : INotificationHandler<ForumPostBeforeSaveNotification> { public void Handle(ForumPostBeforeSaveNotification notification) { var post = notification.Post; //what time is it? if (post != null) { var now = System.DateTime.Now; var lastPostTime = PostFloodControlService.GetLastPostTime(post.GetValue<int>("postAuthor")); var minInterval = 60; //seconds if (lastPostTime != null) { var timeSinceLastPost = now - lastPostTime.Value; if (timeSinceLastPost.TotalSeconds < minInterval) { throw new System.Exception($"You are posting too quickly. Please wait {minInterval - (int)timeSinceLastPost.TotalSeconds} more seconds before posting again."); } } //update last post time PostFloodControlService.UpdateLastPostTime(post.GetValue<int>("postAuthor"), now); } } }
-