why in my case it doesn’t detect the extensions(it happens with other plugins)? did i miss the configurations ? or perhaps typo.
STRAPI VERSION
v4.9.0
CURRENT PLAN
Community Edition
NODE VERSION
v18.0.0
why in my case it doesn’t detect the extensions(it happens with other plugins)? did i miss the configurations ? or perhaps typo.
STRAPI VERSION
v4.9.0
CURRENT PLAN
Community Edition
NODE VERSION
v18.0.0
If you use Typescript, make sure the file is strapi-server.ts not .js. I was struggling with it for hours
Hello all,
I need also to “extend” the Content Manager Plugin “a little bit”. My Problem is following. I have created a Collection Type article. This article owns a dynamic zone, where I add (or can add) many components. This works very good. BUT! The Content Manager does not show the real ID of each component. I want to add this “little feature”, showing me the real ID of that instanciated component element. To write a whole new plugin for strapi is to much I thing. Does a better solution exist to realize that feature?
The screenshot is showing my wish:
regards,
Sven
I have found an elegant way of doing this. I created a lifecyle-hook.
Therefore I’ve created a file src/api/artikel/content-types/artikel/lifecycles.js with the following content:
module.exports = {
afterFindOne(event) {
const { result, params } = event;
new_blocks = Array();
if (result.hasOwnProperty("Blocks")) {
result.Blocks.forEach((element) => {
element.identifier = " ID of Element: " + element.id;
new_blocks.push(element);
});
result.Blocks = new_blocks;
}
}
};
I’ve added also an “identifier”-Tag with type string for each component. Then Strapi plugin-content-manager uses this Tag as a display name. As you can see in my code, I replace this tag with the string “ID of Element …”, so in dynamic zone now the ID of each component appears.
That’s all,
Thank you,
Have a good day,
Sven
Thank you for sharing this.