# Editing new records

**URL:** <https://farmos.discourse.group/t/editing-new-records/1079>\
**Category:** Using farmOS\
**Tags:** feature-request\
**Created:** [January 21, 2022, 2:29pm UTC](https://farmos.discourse.group/t/editing-new-records/1079 "2022-01-21T14:29:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [January 21, 2022, 2:29pm UTC](https://farmos.discourse.group/t/editing-new-records/1079/1 "2022-01-21T14:29:21Z")

</div>

My opinion:

1. When creating new records the name field should be focused automatically.
2. When a log is saved, there should be way to continue with a new log.

Is it possible to adopt hotkey/shortcut keys into FarmOS?

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [January 21, 2022, 3:11pm UTC](https://farmos.discourse.group/t/editing-new-records/1079/2 "2022-01-21T15:11:22Z")

</div>

Interesting ideas @pat!

> When creating new records the name field should be focused automatically.

Good idea. I bet this could be accomplished with some simple JavaScript.

> When a log is saved, there should be way to continue with a new log.

This is a neat idea! Implementing it might be complicated because there are numerous contexts that may lead you to creating a log, however, and not all of them would need/want this feature. So it might require some deeper scoping to think it through.

> Is it possible to adopt hotkey/shortcut keys into FarmOS?

I’ve never done anything with hotkeys in Drupal before - I wonder what’s possible! Or perhaps a more generic JS approach? Do you have experience with either?

---

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [January 21, 2022, 3:51pm UTC](https://farmos.discourse.group/t/editing-new-records/1079/3 "2022-01-21T15:51:09Z")

</div>

> [@mstenta](#):
>
> This is a neat idea! Implementing it might be complicated because there are numerous contexts that may lead you to creating a log, however, and not all of them would need/want this feature. So it might require some deeper scoping to think it through.

Nothing automatic. I was thinking more some kind of button or url to click on for a new entry, so the  
This button could be focued, of course so an Enter or Space keypresspress would activate it.

> [@mstenta](#):
>
> I’ve never done anything with hotkeys in Drupal before - I wonder what’s possible! Or perhaps a more generic JS approach? Do you have experience with either?

No experience. How about this hotkey module?

> **[Hotkey](https://www.drupal.org/project/hotkey)**
>
> The Hotkey module allows you to create accesskey attributes for Drupal form buttons and links on node pages.

Maybe it could simplify saving entries too. Instead of scrolling for the save button.

Ctrl-Shift S for activating the **S** ave button 😍  
Ctrl-Shift N for activating a **N** ew activity log button 😍

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [January 21, 2022, 4:03pm UTC](https://farmos.discourse.group/t/editing-new-records/1079/4 "2022-01-21T16:03:00Z")

</div>

> [@pat](#):
>
> No experience. How about this hotkey module?

I came across that too… no releases and hasn’t been updated since 2014, so it appears to be dead. ☹

Also found this one, but it seems a bit different: [https://www.drupal.org/project/keyboard\_shortcuts](https://www.drupal.org/project/keyboard_shortcuts)

---

<div class="post-metadata">

**Author:** ![paul121](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@paul121](https://farmos.discourse.group/u/paul121)\
**Post date:** [February 6, 2022, 9:26pm UTC](https://farmos.discourse.group/t/editing-new-records/1079/5 "2022-02-06T21:26:39Z")

</div>

@pat this is a neat idea!

It’s for a slightly different problem, but a similar tool I’ve come across is the Drupal [coffee module](https://www.drupal.org/project/coffee) that provides a quick-search feature for navigating Drupal admin pages. The search UI is activated with the alt + D or alt + K keys and displays results as you start typing.

I started a simple [farm\_coffee](https://www.drupal.org/project/farm_coffee) module that adds some custom commands for farmOS assets, logs and plans. You can type `:add log` and it will take you directly to the `Add log` or `Add {log type}` page, depending on which result you choose. There’s also shortcuts for `Assets` and `Logs` listing pages.
