# Attach to (file-level) nodes?

**URL:** <https://org-roam.discourse.group/t/attach-to-file-level-nodes/3418>\
**Category:** Troubleshooting\
**Created:** [April 4, 2024, 11:56pm UTC](https://org-roam.discourse.group/t/attach-to-file-level-nodes/3418 "2024-04-04T23:56:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dankessler](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/dankessler/32/1447_2.png) [@dankessler](https://org-roam.discourse.group/u/dankessler)\
**Post date:** [April 4, 2024, 11:56pm UTC](https://org-roam.discourse.group/t/attach-to-file-level-nodes/3418/1 "2024-04-04T23:56:04Z")

</div>

Suppose I create a new note with `M-x org-roam-node-find foo RET` (and complete the capture process with `C-c C-c`).

At this point my node is essentially devoid of content and looks like

```auto
:PROPERTIES:
:ID: A6C81621-352F-49F0-8519-3B6A4375E98C
:END:
#+title: foo
Lorem ipsum

```

Now I want add an attachment (let’s say a PDF) to this (file) node. I bring up the attachment dispatcher with `C-c C-a`, hit `a`, and indicate the PDF I would like to attach. However, the attachment fails with message

`user-error: Before first headline at position 1 in buffer 20240404164412-foo.org`

Presumably, `org-attach` is angry that I’m before the first headline; indeed since this is a file-level node with not very much content, it doesn’t even have _any_ headlines. I can work around this by creating a new dummy headline so that the node now looks like

```auto
:PROPERTIES:
:ID: A6C81621-352F-49F0-8519-3B6A4375E98C
:END:
#+title: foo

* Dummy Headline

```

move point to somewhere on Dummy Headline, and then try to attach again with `C-c C-a`. It will now work (and add an `ID` property to “Dummy Headline” in the process), but it will have added the attachment to the “Dummy Headline” rather than the “file-level” node.

Is there a workflow where `org-attach` will play nice with my (headline-free) node? Or should I just be in the habit of creating at least one Dummy Headline in which to stash my attachments?

I understand that this fundamentally has more to do with `org-attach` than `org-roam`. However, because `org-roam` seems to make extensive use of org’s so-called [zeroth section](https://orgmode.org/worg/org-syntax.html#orge215994), I was curious what the typical workflow was for other users here. Alternatively, perhaps `org-attach` could be extended to behave sensibly in the 0th section, especially if there is already a `:PROPERTIES:` drawer up there anyway?

---

<div class="post-metadata">

**Author:** ![dankessler](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/dankessler/32/1447_2.png) [@dankessler](https://org-roam.discourse.group/u/dankessler)\
**Post date:** [April 5, 2024, 12:30am UTC](https://org-roam.discourse.group/t/attach-to-file-level-nodes/3418/2 "2024-04-05T00:30:55Z")

</div>

I went looking on the OrgMode mailing list about this, and it was actually discussed [very recently](https://lists.gnu.org/archive/html/emacs-orgmode/2024-03/msg00507.html).

From the thread, I gather that this was [actually addressed on org-mode’s main branch](https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f067a4bd437b83103a82c5ca1e09337047b43de4), but it hasn’t yet made it into a release.
