Hello, everyone.
So, I was trying to build my own plugin (locally) and ran into an issue.
I wanted the plugin’s link to appear on the settings page’s submenu (much like the email plugin), so I used the following configuration object.
export default strapi => {
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
const name = pluginPkg.strapi.name;
const icon = pluginPkg.strapi.icon;
const plugin = {
blockerComponent: null,
blockerComponentProps: {},
description: pluginDescription,
icon: icon,
id: pluginId,
isReady: true,
initializer: Initializer,
injectedComponents: [],
isReady: true,
isRequired: pluginPkg.strapi.required || false,
layout: null,
lifecycles: () => {},
mainComponent: null,
name: name,
preventComponentRendering: false,
trads,
settings: {
menuSection: {
id: pluginId,
title: getTrad('SettingsNav.section-label'),
links: [
{
title: {
id: getTrad('SettingsNav.link.seo'),
defaultMessage: 'SEO Settings',
},
name: 'seo',
to: `${strapi.settingsBaseURL}/${pluginId}/seo`,
Component: () => (
<SEOPage />
),
},
]
}
}
};
return strapi.registerPlugin(plugin);
};
This made the general section on the left side main menu disappear.
I am able to navigate (via the address bar since the setting link does not show up) to my plugin’s page (admin/settings/optionsPage/seo) and everything runs normally.
The culprit here appears to be the menu section code.
menuSection: {
id: pluginId,
title: getTrad('SettingsNav.section-label'),
links: [
{
title: {
id: getTrad('SettingsNav.link.seo'),
defaultMessage: 'SEO Settings',
},
name: 'seo',
to: `${strapi.settingsBaseURL}/${pluginId}/seo`,
Component: () => (
<SEOPage />
),
},
]
}
I however have seen the same way of adding a plugin’s link to the settings menu being used in other Strapi plugins and they seem to work fine.
So, I am not sure what the issue is here, I was wondering if I could get some help with fixing this.
System Information
- Strapi Version: 3.6.5
- Operating System: Elementary OS
- Database: MongoDB
- Node Version: 14.15.3
- NPM Version: 6.14.9
- Yarn Version: I don’t have one installed on this machine.