emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to get the right link using org-capture from the second level
@ 2024-06-25 18:31 Lukas C. Bossert
  2024-06-26 13:51 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas C. Bossert @ 2024-06-25 18:31 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

In my org-roam setup, I want to document information about individuals. 
To do this, I created an org file named `20230501233516-persons.org`, 
which contains two top-level headings: `* Overview` and `* Persons`.

Under the `* Persons` heading, I intend to list all individuals. I've 
created a template that allows me to add people from any other file 
using e.g. `C-c n r i`. This template also facilitates the creation of 
new person entries on the fly, and ideally, it should add a link to the 
person entry in the file I am currently working in.

While the template functions as expected in creating new person entries, 
the link generated points to the ID of the `20230501233516-persons.org` 
file rather than the newly created person entry. How can I adjust my 
template so that it correctly links to the new person's entry instead of 
the ID of the `20230501233516-persons.org` file?

Here is my template:
```
   (setq org-roam-capture-templates
         '(("p" "person" entry
            "** %^{Name|${title}}
:PROPERTIES:
  :ID:          %(org-id-uuid)
  :AFFILIATION: %^{AFFILIATION}
  :ROLE:        %^{ROLE}
  :PROJECT:     %^{PROJECT}
  :CAPTURED:    %U
:END:\n%?"
            :target (file+olp "20230501233516-persons.org" ("Persons"))
            :unnarrowed 1
            )
           ))
```

My system:

```
system     MacOS 14.5 Darwin 23.5.0 arm64 mac
emacs      29.1 EMACSDIR=~/.config/emacs/
 
EMACS=/opt/homebrew/Cellar/emacs-mac/emacs-29.1-mac-10.0/Emacs.app/Contents/MacOS/Emacs
doom       3.0.0-pre PROFILE=_@0 HEAD -> master a99c6b90 2024-06-23 
17:15:51 -0400
            ~/.config/doom/

Org mode version 9.8 (9.8-??-39272e216
```

Thanks, Lukas

(Note: I also asked this question on 
https://emacs.stackexchange.com/questions/81591/how-to-get-the-right-link-using-org-capture-from-the-second-level)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-26 14:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-25 18:31 How to get the right link using org-capture from the second level Lukas C. Bossert
2024-06-26 13:51 ` Ihor Radchenko
2024-06-26 14:26   ` Lukas C. Bossert
2024-06-26 14:35     ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).