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

* Re: How to get the right link using org-capture from the second level
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2024-06-26 13:51 UTC (permalink / raw)
  To: Lukas C. Bossert; +Cc: emacs-orgmode

"Lukas C. Bossert" <mail@lukascbossert.de> writes:

> 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.
> ...
> Here is my template:
> ```

I do not see anything in your template that creates links.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: How to get the right link using org-capture from the second level
  2024-06-26 13:51 ` Ihor Radchenko
@ 2024-06-26 14:26   ` Lukas C. Bossert
  2024-06-26 14:35     ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas C. Bossert @ 2024-06-26 14:26 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

I thought that `org-roam-node-insert` (`C-c n r i`) is doing that. It 
works fine when I use it with the default template or when I create a 
new node at toplevel of a file.
My workflow is that I am working on a file (e.g. `house.org`) and then I 
want to add a reference to a person, for example the janitor of the 
house. So I am envoking C-c n r i and in case I don’t have the person in 
my database yet, Emacs asks me which template I want to use and I am 
selecting "p" for person. The entry for the janitor is correctly created 
in my file `persons.org` but in `house.org` the link is wrong, because I 
don’t get back the link to the janitor-node but to the file/node of 
`persons.org`. (Sorry, if this procedure was too obvious).




On 26.06.24 15:51, Ihor Radchenko wrote:
> "Lukas C. Bossert" <mail@lukascbossert.de> writes:
> 
>> 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.
>> ...
>> Here is my template:
>> ```
> 
> I do not see anything in your template that creates links.
> 

-- 
Dr. Lukas C. Bossert
Bussardstraße 16
52134 Herzogenrath-Kohlscheid/Bank
mail@lukascbossert.de

OpenPGP Schlüssel: 405E2C3EEF751C8C8DF62F503BD814D140275138


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

* Re: How to get the right link using org-capture from the second level
  2024-06-26 14:26   ` Lukas C. Bossert
@ 2024-06-26 14:35     ` Ihor Radchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2024-06-26 14:35 UTC (permalink / raw)
  To: Lukas C. Bossert; +Cc: emacs-orgmode

"Lukas C. Bossert" <mail@lukascbossert.de> writes:

> I thought that `org-roam-node-insert` (`C-c n r i`) is doing that...

I see. Then, I am of no help. I am not familiar with org-roam.


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ 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).