Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a commenting module #14919

Closed
DemeSzabolcs opened this issue Dec 18, 2023 · 21 comments
Closed

Create a commenting module #14919

DemeSzabolcs opened this issue Dec 18, 2023 · 21 comments
Milestone

Comments

@DemeSzabolcs
Copy link
Contributor

Is your feature request related to a problem? Please describe.

O1 has a commenting module , but Orchard Core doesn't.

Describe the solution you'd like

A new module called Comments or Commenting or something like that should be added to Orchard Core. Feature set:

  • Commenting, on the chosen content types (on the frontend of course).
  • The ability to comment when there is no user registration on the site (by providing email and name).
  • Sending the commenter an email if there is a new comment. (This could be done with workflows).

There were discussions about this already, see:
https://github.com/jsalgado10/Commentator.OrchardCore
#2942
StatCan/StatCan.OrchardCore#73

Describe alternatives you've considered

I haven't, I think OC need a commenting module too.

@Piedone
Copy link
Member

Piedone commented Dec 18, 2023

I don't think subscribing to a comment thread, i.e. sending the commenters e-mails optionally (not talking about the owner of the site) can easily work with Workflows. You'd need a custom activity for that at least.

Also, an alternative for commenting apart from a built-in or custom Comments module would be to use an external system like Disqus. A concern here post-GDRP is privacy: for you as a site owner, every embedded widget is a liability and you have to make sure that the provider complies with GDPR, as well as that you include them appropriately in your privacy policies.

@agriffard
Copy link
Member

@hishamco
Copy link
Member

I planned to add both Disqus and Giscus to Orchard Core Contrib (OCC), but then I remembered @agriffard already implemented Disqus, it would be nice if you add it to OCC and I will implement the other one

Backing to the original thread, we might have a simple commenting system like Orchard, this could be useful for TheBlogTheme

@loid345
Copy link

loid345 commented Dec 20, 2023

@Piedone
Copy link
Member

Piedone commented Jan 15, 2024

What I'd do here is a very constrained feature set:

  • CommentsPart:
    • If attached, will add commenting to a content type. You can also use this to display a comment box widget anywhere too.
    • Similar to ListPart (maybe using ListPart?), is the parent of Comment items, also making it possible to list Comments corresponding to a Comments Part-using item on the admin. Unapproving a comment is unpublishing it, or you can delete it like any item.
  • Comment:
    • Name, optional related user for logged in ones, markdown-formatted message (if the latter can be safe; if not, then plain text with line breaks and that's it). The related logged in user can come from CommonPart; if set, that's displayed, if not, Name. One of the must be provided.
    • It's a content type, so content events work (and thus e.g. you can create a workflow to send an e-mail for new comments).
  • List comments: by created DESC in one list. No threading and no paging.
  • Pluggable antispam feature, with ReCaptcha (from the ReCaptcha module) and a honeypot field.

What do you think?

The Orchard 1 Comments module might be used for some inspiration but this would be green-field.

@MZole
Copy link
Contributor

MZole commented Jan 15, 2024

I will start working on this tomorrow. I'm just commenting to let everyone know, since I can't assign to this issue.

@hishamco
Copy link
Member

hishamco commented Jan 16, 2024

@MZole it's yours now :)

@MZole
Copy link
Contributor

MZole commented Jan 26, 2024

I was wondering, what's the standard approach for a 'custom' content migration like this Comment?
I saw several approaches for migrations, like recipe migrations, MapIndexTables and adding the fields in a type's part like this:

await _contentDefinitionManager.AlterPartDefinitionAsync(nameof(CommentsPart), builder => builder
    .WithField(nameof(CommentsPart.Name), field => field
        .OfType(nameof(TextField))
        .WithDisplayName("Commenter's Name"))
    .WithField(nameof(CommentsPart.RelatedUser), field => field
        .OfType(nameof(TextField))
        .WithDisplayName("Related User"))
    .WithField(nameof(CommentsPart.Message), field => field
        .OfType(nameof(HtmlField))
        .WithDisplayName("Message"))
    .WithDescription("Provides a way to add comments to content items."));

await _contentDefinitionManager.AlterTypeDefinitionAsync("Comment", type => type
    .WithPart(nameof(CommentsPart), part =>
        part.WithPosition("0")));

Is this example a great approach in this use-case?

@Piedone
Copy link
Member

Piedone commented Jan 26, 2024

Better use WithField<T> but otherwise as a migrations good.

However, the name and related user shouldn't be stored in text fields, rather as custom properties on the part. Having a corresponding index table would be useful too.

And we definitely don't want to allow people to write HTML in the message. As mentioned, rather have a Markdown-formatted message if it can be safe; if not, then plain text with line breaks.

@sebastienros
Copy link
Member

This should be a community (external) module. There are too many issues with commenting:

  • It's a front-end module, heavy on design/customization work
  • Threads / No Thread
  • Content ownership
  • SPAM
  • Markdown/...
  • Perf
  • Notification

It's a huge piece of work and that might be too much load to handle in this repository (bugs, feature requests, disagreements, ...)

@Piedone
Copy link
Member

Piedone commented Feb 1, 2024

It's certainly easier as a community module (since then you all don't have a say in it :D) but I think having some kind of core commenting module is a base CMS feature. If you have a blog now, which comes with a built-in recipe, you need to either develop this yourself, or have to use an external service, including its privacy and monetary (you either pay or your users see ads) implications.

@hishamco
Copy link
Member

hishamco commented Feb 1, 2024

If you have a blog now, which comes with a built-in recipe, you need to either develop this yourself,

Exactly, I'm with Zoltan we should have a minimalistic comment module, but we could do one with more features as a community project in Orchard Core Contrib or Lombiq or anyone interested

@hishamco
Copy link
Member

hishamco commented Feb 9, 2024

@MZole any updates on this?

@sebastienros
Copy link
Member

I would personally (meaning it engages only myself, others can disagree and ignore my view) be opposed to such feature in the main repository for the reasons I exposed. I am totally supportive of any external effort to have it as a different org/repository so it's clear that nobody should expect support from contributors outside if its own repository.

@hishamco
Copy link
Member

hishamco commented Feb 9, 2024

What if we provide a simple flat comment system at least for TheBlogTheme, I'm with you Seb that this module has many requested features and could be managed completely outside this repo

@sebastienros
Copy link
Member

I would suggest providing integration with commenting solutions like giscus (for a technical blog) or disqus (more general blog) as a basic offering. The maintenance would then be limited to ensuring that the integration just works, no complexity for theming, auth, perf, ...

@hishamco
Copy link
Member

hishamco commented Feb 9, 2024

I planned to add Giscus to Orchard Core Contrib (OCC) but if this is accepted in OC I will move my effort here instead

@hishamco
Copy link
Member

hishamco commented Feb 9, 2024

Or we could you use Disqus here for simplicity

@MZole
Copy link
Contributor

MZole commented Feb 12, 2024

I did progress with this a lot, but ultimately we can understand if you don't want this type of solution for the reasons you mentioned.

If you already had planned your integration, please take it from here @hishamco, I'm unassigning.

@MZole MZole removed their assignment Feb 12, 2024
@Piedone
Copy link
Member

Piedone commented Feb 12, 2024

WIP code is here if anybody wants to pick this up: https://github.com/Lombiq/OrchardCore/tree/issue/OCORE-133

@Piedone Piedone closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2024
@hishamco
Copy link
Member

If there's no willing to add it, I might start with simple Giscus or Discus then I might reviisit the link that you refer too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants