Giter Club home page Giter Club logo

Comments (2)

mauricerenck avatar mauricerenck commented on August 15, 2024

Hey Juan,

thank you for the kind words :)

Yes, you can do that. The plugin is already using JavaScript for sending comments to kirby, the regular form action is a fallback only.

There is a POST endpoint available under /komments/send which takes the form values as body. So you can steal the form from the snippet in snippets/kommentform.php. And have a look at the JS file in assets/komments.js. Be aware that there are two hidden fields which are used for spam protection, so don't forget to add them, even if they aren't visible.

There is currently no api endpoint for getting the comment list, but I guess you'll do that on build time. The comments are stored in a structured field. I would recommend to use $komments = $kommentUtils->parseKomments($page->kommentsInbox()); as you can see in snippets/webmention-splitted.php.

It may be that I will switch from structured field to sqlite in the future, so using $kommentUtils->parseKomments(); will ensure that your comments show up even if their storage might be changed.

Let me know if there are any problems or questions.

Best,
Maurice

from komments.

thebraunfox avatar thebraunfox commented on August 15, 2024

Hi Maurice,

Great, thanks for the prompt and detailed answer. I'll give it a try and I'll let you know how it went.

Best,
Juan

from komments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.