Hi everyone,
I’m implementing a lightweight custom comment solution for a headless Umbraco v13 + Next.js blog (niche site, ~10–30 comments per month, no third‑party SaaS). I’ve decided to model the link between a Blog Post and its Comments using the Umbraco Relations API. I’d really value feedback on whether this design is sound, and if there are pitfalls I’m overlooking.
Core Idea
-
A single
CommentDocument Type; every comment is a content item based on this Document Type -
A “Comments” container content item (using a List View) that holds all Comment nodes to centralize moderation.
-
A custom Relation Type defines a one‑to‑many relationship:
-
Parent object type: Blog Post (Document)
-
Child object type: Comment (Document)
-
Direction: Blog Post → Comment (unidirectional)
-
-
When a new Comment is created and saved, the system creates a relation linking that Comment to the Blog Post.
-
Add a custom tab on each Blog Post content item that lists only the related comments. Each comment to link to edit-view for easier moderation.
-
A boolean
approvedproperty (defaults to false). Only items whereapproved = trueare exposed to the public delivery layer / headless API.
Data Model (Initial Draft)
Comment Document Type properties:
-
AuthorName (string)
-
AuthorEmail (string or optional)
-
Content (plain text or sanitized limited markup; length capped)
-
CreatedDate (set automatically on creation or stored explicitly)
-
Approved (bool, default false)
-
BlogPostReference (either relation or stored UDI/Key)
-
IP (possibly hashed for privacy + rate limiting)
Moderation Approach
Given the low volume, I intend to start simple:
-
Use the List View on the “Comments” container to open a Comment content item and toggle
Approved. -
Add custom List View columns: Excerpt, Blog Post Title, Approved?, Created Date, Author (and maybe hashed IP).
-
On each Blog Post’s “Comments” tab: show related comments (sorted newest first) with a link that opens the specific Comment content item in the backoffice for editing/approval.
Public Submission Flow
-
Blog post page renders already approved comments by calling a read‑only endpoint filtered on approved = true.
-
Public comment form POSTs to a custom endpoint (e.g. /api/comments/submit).
-
Endpoint validates + sanitizes, then creates a new Comment content item (Approved = false).
Security / Abuse Mitigation (Right-Sized)
-
Server-side + client-side sanitization of user input
-
Length limit for Content
-
Basic IP-based rate limiting
-
CSRF-token for submission form
-
Authentication for API-endpoint
-
(Maybe:) Implement honeypots
-
(Maybe:) Implement captcha
Does this overall approach look sensible for a low-volume scenario? Am I overlooking a simpler pattern—or a future regret?
Thanks in advance for any guidance or “we tried that and wish we’d done X” stories!