Closed SkipTheDragon closed 2 years ago
Hello @SkipTheDragon ,
The Comment
collection is an internal one of the plugin. Anyway if you want to extend it you can simply use the Strapi Extensions mechanism.
models
and copy comment.settings.json
extensions/comments/models/comment.settings.json
Read more here based on Strapi Content Manager extension: https://strapi.io/documentation/developer-docs/latest/guides/custom-admin.html#update-the-content-manager
Keep in mind that by doing your own extensions, we might be no longer able to support you with issues.
- Go to plugin source:
models
and copycomment.settings.json
Where is this file located? can't seems to find models
directory
@Nisthar As you see based on the dates, advice was for v3 compatible version :) current v4 supported by plugin in v2.x
got it managed differently.
You should extend the file from content-types/comment.js
using Strapi v4 extensions approach.
@cyp3rius when overwriting the content-type, do i have to create the schema (in schema.json) for all the fields that were already there or just the new ones?
@Nisthar As that is js file you can import original one and extend proper fields by spread operator. Please follow official Strapi v4 docs for Plugins extensions.
@Nisthar As that is js file you can import original one and extend proper fields by spread operator. Please follow official Strapi v4 docs for Plugins extensions.
Don't i need to use .js to import or use spread operator? It seems like strapi only supports .json file
Not entirely, in v4 its allowed and as you check our codebase we also support it.
Ok just tried it, didn't work
pasted comment.js file into ./extensions/strapi-plugin-comments/content-types/comment.js, added some fields and restarted the server. Doesn't seems to work.
Let me please back to you on Monday. And also, create separated issue dedicated for v4, do not follow discussion in closed issues.
Let me please back to you on Monday. And also, create separated issue dedicated for v4, do not follow discussion in closed issues.
sure, i think there's no need for that now. The solution was to change the plugins name and its working 👍 EDIT: The updating only seems to capture the content of the comment (update doesnt work for custom fields)
Hello, I would like to add an url field to the comment collection, but i don't know where to edit it (can't find it in content-types). Can i add it directly in the sql table?