Remove / Hide items from the + New context menu

I searched for hours and I can’t find a way to remove “New Diagram” and “New draw.io Whiteboard” from the + New menu in Nextcloud Files.

This is very annoying because I’m not using both applications and I never asked for them to be there in the first place. I tried Custom CSS but this menu is coded in a way it can’t be customized without complicated CSS or JS. BTW the only javascript app I’ve found is 3 years old and doesn’t work since NC22.

draw.io is a third-party app that you must have intentionally installed from the App Store at some point. Just uninstall it and the two related items should disappear from the menu.

“New Diagram” is associated with “Draw”, which is part of Collabora Online / Nextcloud Office, and I don’t know of any way to remove it without removing Collabora entirely. Maybe there is a way to disable “Draw” in Collabora Online, but this question is probably better asked on: https://forum.collaboraonline.com/

I’ve installed Draw.io and I believe Whiteboard comes with it but I don’t want it. If I could just hide it it would be practical.

Same thing goes for New diagram, it would be much easier if we could customize and hide stuff from that menu instead of contacting every application support forums to do so.

Hi @LightWater

What Nextcloud version?

What exactly did you try?

It is very easy to remove those <li> Elements with CSS

Example for “New diagram” on a Nextcloud 27.x

li a[data-templatename="New diagram.odg"] {
    display: none !important;
}

You can find out the coresponding data-templatename with the Developer Tools from your browser (Ctrl+Shift+C). Simply replace “New diagram.odg” from the above example code with the data-templatename you want to remove.


Much and good luck,
ernolf

What Nextcloud version?

NC 29.0.0

What exactly did you try?

I tried adding all sort of CSS into the custom css application from elements I found in the browser editor. Although it doesn’t seem like v29 have any element that defines a unique <li>.

I tried your code and unfortunately it’s not working. I also tried without .odg and/or without New diagram at all and still no luck.

Here’s a screenshot of what I have.

If I look at the code it seems different in my version, perhaps there’s some tweaking I should add. There’s data-v-eca9500a="", data-v-74df2152="" and data-v-eca9500a="" which are also present on every <li> elements.

The New diagram text string doesn’t have .odg extension and isn’t in the quotes of data-templatename="".

I tried all possible iteration of templatename listed above, with or without New diagram or New diagram.odg. Examples;

li a[data-v-51d9ee64="New diagram.odg"] {
    display: none !important;
}
li a[data-v-51d9ee64="New diagram"] {
    display: none !important;
}
li a[data-v-51d9ee64=""] {
    display: none !important;
}

Thank you so much for helping, I really appreciate it.