Website with comments
Last updated
Was this helpful?
Last updated
Was this helpful?
In this tutorial, you will learn how to enable comments on your SAFE website!
We built two comments plugins: one for permanent comments and the other for editable comments. These plugins demonstrate the usage of .
Both plugins let people comment on content using their . They also enable the website owner to delete comments and block users.
This tutorial will showcase how to:
You will learn about the following APIs:
Browse the source code on GitHub:
1. SAFE Launcher
2. SAFE Browser
3. SAFE Demo App
1. Clone this GitHub repository
2. Add this folder to your website
Permanent comments:
Editable comments:
2. Add this code snippet to your SAFE website
If you specify the __COMMENTS_ID
as shown above, the library will automatically initialize at startup and add the comments UI to the specified element. Omitting that reference, comments won't be loaded automatically but need to be invoked directly via:
3. Upload your website using SAFE Demo App
Upload your website folder to the Public folder of SAFE Demo App and map that folder to a service and a public name (e.g. blog.example
).
4. Open your website using SAFE Browser
Go to the URL of your website (e.g. safe://blog.sample
). Select a page where you added the comments plugin and enable the option to allow comments for that page by clicking on the Enable Comments
button. This button is only visible for the website owner. Once enabled, logged-in users who visit the page should be able to comment. The website owner can delete comments and block users.
AppendableData
has a size limitation of 100 KiB. New comments can't be added if the appendable data has reached its maximum size.
(for permanent comments)
(for editable comments)
Start and log in.
Start .
Start .
If you don't have Git installed, you can download it from .