1

folder structure craft 3design new page

I need an to add an import page to a craft CMS. But although I have experience as a full stack programmer I don't see how to add a page to the menu of the CMS. How is this done? Can anyone tell me? I just need a page with an input component on it. The rest I would like to do with Javascript interfacing with GraphQL.
2

A good place to put interfaces and tools that aren't super expansive or accessed very often is the Utilities section in the backend. Adding new utilities is very simple, you just add a class that implements the Utility interface (you can extend the base class, then you only have to provide a title and the HTML body). Then register that utility class using the event Utilities::EVENT_REGISTER_UTILITY_TYPES. See the documentation on Utility Types for details.

You can also add new top-level items to the navigation menu. First, add a controller that responds to a URL with the HTML content for your custom page. Then use the event Cp::EVENT_REGISTER_CP_NAV_ITEMS to add a custom link to the control panel navigation that links to your controller action. See the documentation on Control Panel Sections for details.

Custom utility types, controllers and event hooks can be placed in a site-specific module. See the documentation on How to Build a Module. Those are usually placed in the modules/ directory in your project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.