Does org-roam-node-find use templates?

I’m unsure yet if I will try to revert to v1. I have a template that I’ve tried to migrate to v2:

(setq org-roam-capture-templates
'((“d” “default” plain “%?” :if-new
(file+head “${slug}-%<%Y%m%d%H%M%S>.org” “#+title: ${title}\n”)
ID: %(org-id-new)
#+title: ${title}
#+headline: ${title}
#+filetags: "
:unnarrows t)))

When I create a new file, it only includes the properties drawer and the title. So, I guess it’s not using the template. Does it use a different template?

Also, after adding the other markup. Trying to link to the file using [[roam:…]] doesn’t seem to work.

Can you tell what the problem might be?

Three suggestions:

  1. Do not use :head
  2. Remove one of the “#+title:” assignments
  3. Explicitly calling org-id-new is not needed (Org-roam V2 does it for you)

Instead of this:

Try something like:

(setq org-roam-capture-templates
      '((“d” “default” plain “%?” :if-new
              (file+head "${slug}-%<%Y%m%d%H%M%S>.org"
                         ":PROPERTIES:\nID: %(org-id-new)\n:end:\n#+title: ${title}\n#+headline: ${title}\n#+filetags: \n")
              :unnarrows t)))

I can’t test my suggestion right now – I left it there but I would remove org-id-new and the whole properties drawer.

I suggest that you look at the documentation of org-roam-capture-templates a bit more in detail and review my suggestion.

1 Like

You want a colon before the ID too, right?

1 Like

Yes. Thanks :slight_smile:
I’d take out the whole property drawer and let Org-roam add an ID as @kenneddoll uses Org-if-new.

Thank you. This appears to be working using your example, without the property drawer.

1 Like