Closed liaprins closed 7 years ago
Individual comment pages are currently visible, but their parents, comments pages, are invisible.
Currently, you can only change the naming of the comments page. The recommended way of doing this is by setting the pages.comments.dirname
option in your config.php:
c::set('comments.pages.comments.dirname', 'my-custom-comments');
Making individual comments invisible is currently not supported by the plugin. If you think this would be a useful feature, please replay. Maybe a boolean option for making comments invisible?
Thanks for your quick reply!
I believe I would need a way to turn off the visibility of all individual comments' pages/folders, to make them all invisible for my purposes.
I have also made a Kirby forum question that explains the reason for why I need this (the comments are showing up as their own pages in search results using the Kirby search, and I do not want them to). I have tested by manually taking the prepended number off of individual comment folders, and it doesn't affect the comment in the UI at all: it still shows up.
For example, here I manually made comments 1 through 3 invisible, while comment 4 is visible (all still are showing up on my site):
I would definitely be in favor of a way to turn off the visibility of all individual comments! Let me know if you think this is do-able? Thanks so much for your help!
In general I don't think relying on the date is a good idea. From my experience the date can be changed by the OS or some other program. I was dependent on the dates in one of my projects and suddenly all the dates was reset for some unknown reason. Prefixed with numbers is the best solution, I think.
@liaprins With that search function. You could probably make an if statement to check if the parent is a comment parent?
Sound like an obvious option to add to the plugin. The implementation isn’t complicated, but I have to make sure no code breaks by introducing this new behaviour.
Edit: the new option will allow to remove the index-number-prefix, not set dates. @jenstornell’s comment outlines why working with dates isn’t an ideal solution for user generated data.
Thank you for working on this so quickly!
However, I have added the new comments.php file to the comments/plugins folder, and have added the code to the config.php file, and am now testing by creating new comments in my UI. They all still are prepended by the number, though (when I go into the content folder and find their folders)... :(
Here is the line I added to my config.php:
c::set('pages.comment.visible', false);
as found in line 83 of the new Readme.md file.
Any ideas? Thanks so much!
All options are namespaced with the comments.
prefix. This makes sure, that no Kirby Comments option collides with Kirby’s or other plugins configurations.
c::set('comments.OPTION_NAME', $value);
In your case:
c::set('comments.pages.comment.visible', false);
I'd like to make it so each comment's folder does not prepend with the comment number, so that the folder is invisible in Kirby. I can figure out how to change the comment folder's number to being prepended by date (in the comments.yml blueprint). But I need to set the folders having no number at the front and thereby being invisible.
Where/how can this change be made? Thank you so much!