wintercms / wintercms/winter

Add "New Item" shortcut menu

Open
#1,142 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.5k
Forks
246
Avg merge
19h 2m
Merged PRs (30d)
7

Description

Package targeted

Winter CMS

Description

One of the friction points I've found with the CMS is that if you want to quickly add something, like say a blog post, to the site, it currently requires multiple clicks and page loads to get to where you need to go to add the item. Using the blog posts example, it's a case of clicking the "Blog" main menu item, then clicking "Posts" in the side menu, then clicking the "New post" button on the top of the Posts list (I'm aware there's a "New post" shortcut in the sidebar, but a lot of plugins don't provide that).

A methodology I've seen on other sites is providing shortcuts to quickly create something - for example, on Figma, the buttons to create a new design or new Figjam diagram are immediately available when logged in. To this, I wonder if we provide a "New item" shortcut menu that plugins can hook into to provide shortcuts to quickly add an item that the plugin provides. Here's a mockup of what I'm thinking:

New Menu Mockup

The idea being, we limit the scope of this menu to be simply for "adding" something to the site. Of course, there's no way to enforce this - we just have to trust that plugin developers will respect that scope - but if followed, it would be an easy way for someone to jump straight into creating an item from anywhere within the Backend.

I imagine that such a link (or links) could be created using a method in the Plugin definition file like with navigation items being registered through the registerNavigation method. This could potentially be registerCreateMenuLinks, supporting an array of links with a minimal set of options:

public function registerCreateMenuLinks()
{
    return [
        [
            'title' => 'New Layout',
            'icon' => 'th-large',
            'url' => Backend::url('cms/layouts/new'),
            'rank' => 100,
        ],
        [
            'title' => 'New Page',
            'icon' => 'copy',
            'url' => Backend::url('cms/pages/new'),
            'rank' => 101,
        ],
    ];
}

Links would be grouped together by plugin name in the menu itself, so that it's immediately clear which plugin is providing the link.

Will this change be backwards-compatible?

It will be a new feature, so no backwards compatibility needs to be considered.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing registerNavigation implementation and the backend menu entry points; the issue does not name specific files or tests. Define how plugins would register grouped creation links, then verify that a New Item menu can display those links from anywhere in the Backend and open the supplied URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.