Comments Stack: Edit the database file browser-side?

Hi @willwood and others.

I want to add the comments stack to a site but set it up so that the client can edit the database file. Any ideas how best to do it?

I’m thinking a single page behind a password which displays the file and allows it to be edited. No idea if there is a way to display the file on a webpage though, and have it editable!

Other ideas welcome.

Create a simple (S)FTP account that points directly to the datafile and have the client bookmark it or save it as a ‘droplet’ (the exact terminology varies based on the software used). Then they can login with one-click and open the datafile in their preferred text editor.

Note you will need to educate your client on use of Unix Epoch time formats and point them to a suitable time converter online.

Sadly that just isn’t going to happen. I’ve attempted to get clients to use FTP for this sort of thing before, they won’t/can’t. If I’m pitching a job and this is a requirement, they just go elsewhere.

I have put together a system using @Jannis Repo stack, and it might work. And on that note I have a question for Jannis…

This is a screenshot of the repo page attached with the Comments database, there are two files, I only want the client to be able to edit one. Is there a way to “hide” the other? The one that I need to hide is database-001-ratings.txt.

Also Jannis, is there a way to have a file in the repo folder appear in the browser window and be editable?

Also, is there a way to stop files opening in the browser when the filename is clicked?

I’m thinking a repo “edit” stack, that you can dropped on to a page, in the settings put the path to the file, and have the file editable with a save button?

All you can do is hide file extensions (black / whitelist).

Everything else isn’t possible.


Thanks all the same.


I’ve managed to get the ratings file hidden in Repo by simply putting a . at the start of the filename.

Comments appears to be working as it should.

Is what I’ve done likely to cause any issues down the line?


EDIT: Scrap that: Comments simply recreated the ratings file!

The name and location of the datafiles is changeable in the stack settings.

But obviously if you change them from the default values, then you’re on your own so far as testing and seeing what works.

Ignore that last post Will, it was just me being thick.

Got another weird one at the mo:

I’ve set Comments to display over two columns, and one of the cards is getting split over the two columns.

Attached an image incase you’re not getting the same display your end.

Theme is Foundation.

.guest-item {
    -webkit-column-break-inside: avoid;
     page-break-inside: avoid;
    break-inside: avoid;
    display: inline-block;
    width: 100%;
1 Like

Great stuff, thanks Will.

I’ve now shown the client the demo of Comments and Repo (with the column issue but i assured them that would be fixed soon) and they’re happy with it, so sorted on that front now. It’s not the most elegant solution, but certainly a workable option.

Out of interest, have you ever had a feature request to build in the option for clients to remove comments?

Hi again @willwood

On mobile the cards are getting cropped. Tested on Foundry and Foundation. Visually different things happening, but both have the same issue.


If you put the screen into mobile mode you’ll see the problem.

width 100%;


width: calc(100% - 3.5rem - 2px);

(width = 100% - margin/padding - border)

Thanks Will.

It kinda works, I got a similar result just changing the percentage of the width, but depending on the screen size the right margin (as in space between the card and the border of the container) varies in terms of ratio: On small screens it’s too big, on bigger screens too small, in that it doesn’t balance with the left margin.

Is there no way to have it adjust/scale the same as the left margin?