Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Keyboard shortcut for 'Save and add another' #2851

Closed
bensomething opened this issue May 6, 2018 · 6 comments
Closed

Feature Request: Keyboard shortcut for 'Save and add another' #2851

bensomething opened this issue May 6, 2018 · 6 comments
Labels
authoring ✍️ features related to author experience enhancement improvements to existing features
Milestone

Comments

@bensomething
Copy link

Having Command + S as a shortcut is so great, but sometimes I find myself having to enter a bunch of entries manually and would love to have Shift + Command + S (or similar) mapped to Save and add another.

@brandonkelly brandonkelly added enhancement improvements to existing features authoring ✍️ features related to author experience labels May 7, 2018
@CreateSean
Copy link

Plus one to infinity

@lindseydiloreto
Copy link
Contributor

lindseydiloreto commented Jul 18, 2019

This would be such a lifesaver. I'm about to enter 150 categories in manually.

Also... wouldn't it be pretty easy to implement? Maybe someone should do a PR.

@Mosnar
Copy link
Contributor

Mosnar commented Jul 18, 2019

@lindseydiloreto I would suggest using Feed Me on a Google Sheet or CSV instead of entering all of those manually.

@lindseydiloreto
Copy link
Contributor

I'm reading them off of a piece of paper. 😢

@lindseydiloreto
Copy link
Contributor

Alright, I've got a pretty solid JS workaround. Using the CP JS plugin*, I injected this...

$(function () {
    var redirect = '485b4c6a1848521a679e1e58ce5c90756067d76a8cc20b1ab9566a9f503e1363categories/industryTypes/new?parentId={parent.id}#';
    $('input[name="redirect"]').val(redirect);
});

When the page loads, it'll automatically update the form's hidden input field. It swaps out the default value for the already-hashed string you specify.

Now when adding new categories, you can just hit enter and immediately start typing the next one! 🎉

If you copy this code, the redirect value on your site would be different from mine. I copied this value from the "Save and Add Another" button (it's attached as the data-redirect attribute).

I plan on using this workaround briefly, then removing it as soon as I'm done. If I intended to keep it in place longer, I would do a better job of targeting the hidden redirect field. Most likely, I'd use the CP Body Classes plugin* to more accurately hone in on that specific page.

Hope others may find this helpful until a shortcut is added to core!


* Disclaimer: I'm the author of both of those plugins.

@brandonkelly
Copy link
Member

Just added this for Craft 3.5.

Went with Shift + Ctrl/Command + S.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authoring ✍️ features related to author experience enhancement improvements to existing features
Projects
None yet
Development

No branches or pull requests

5 participants