# Nodes with same title

**URL:** <https://org-roam.discourse.group/t/nodes-with-same-title/3614>\
**Category:** Requests\
**Created:** [October 11, 2024, 5:11pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614 "2024-10-11T17:11:25Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![orgroamer](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@orgroamer](https://org-roam.discourse.group/u/orgroamer)\
**Post date:** [October 11, 2024, 5:11pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/1 "2024-10-11T17:11:25Z")

</div>

How do you handle nodes with the same title? Sometimes it can be very clunky to come up with a unique title, for example if have a similar sort of structure within multiple locations of my network. I have to resort to some sort of prefix like SPECIFIC\_TOPIC, then the rest of the title. But this just feels like it is re creating folders, which I do not want to do. I know this is definitely possible, because org-roam actually uses IDs for links and not titles, but how would you do it in practice?

I think maybe, if I could select between multiple nodes with the same title in org-roam-node-find? Perhaps if there was some context that shows some of the node content, so I know which one it is. Or if there was a :context: field in org properties, that displayed in brackets after title. (I know I could just add context in brackets after the title, and then I could stop the brackets displaying when linking those nodes, but it’s breaks my flow to immediately have to think about things not relevant to the node itself like that).

Maybe I want an ability to encapsulate some nodes to different contexts? Maybe an option to exclude certain notes from org-roam-node-find might work?

Does anyone have a workflow for this?

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [October 11, 2024, 5:33pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/2 "2024-10-11T17:33:39Z")

</div>

“Context” can be presented in minibuffer with minimal configuration if you use one of the following constructs already available:

- Directory ([config example in wiki](https://github.com/org-roam/org-roam/wiki/User-contributed-Tricks#filtering-by-subdirectory))
- Tags (see README and documentation of `org-roam-node-display-template`)
- Parent headlines (for headline-nodes; [config example](https://github.com/org-roam/org-roam/wiki/User-contributed-Tricks#showing-node-hierarchy))

You can add a custom property (:context:) and show it on the minibuffer, too, but I would try to stick to available options such as these above.

“Encapsulation” can be achieved by passing a filter function to `node-find`. Some examples are documented in the [wiki](https://github.com/org-roam/org-roam/wiki/User-contributed-Tricks#some-filter-fn-examples).

You indicated your aversion to some options above. Perhaps you could give us some of your real examples and discuss the matter further. As for me, I would not have an issue of clashing titles — my titles are rather long, which can be an issue in itself…

---

<div class="post-metadata">

**Author:** ![orgroamer](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@orgroamer](https://org-roam.discourse.group/u/orgroamer)\
**Post date:** [October 11, 2024, 9:36pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/3 "2024-10-11T21:36:25Z")

</div>

Thank you for pointing me toward those resources. Yes, I would also prefer to use in built methods rather than inventing my own.

My primary issue was I’m not sure how to create 2 nodes with identical titles, or if it’s possible without further modification.

---

<div class="post-metadata">

**Author:** ![orgroamer](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@orgroamer](https://org-roam.discourse.group/u/orgroamer)\
**Post date:** [October 11, 2024, 9:51pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/4 "2024-10-11T21:51:03Z")

</div>

Where this came up recently for me was, I was splitting a specific project into “Day 1”, “Day 2”, etc, with each of the days as their own nodes… but if I have other projects I want to split in the same method, the “Day 1” etc titles are identical. So I want a way of differentiating between them, but one where I don’t have to do that in the title because I prefer my organisation to come from the structure of the nodes themselves.

If having same titled notes is possible, perhaps the best solution is excluding them from org-roam-node-find altogether, and only navigating to them from other nodes?

---

<div class="post-metadata">

**Author:** ![dmg](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dmg](https://org-roam.discourse.group/u/dmg)\
**Post date:** [October 12, 2024, 2:36am UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/5 "2024-10-12T02:36:51Z")

</div>

I use consult-org-roam. It is an amazing package that makes it easy to find the node I am looking for. Try it.

another suggestion is that you add olp to the template:

Try this. When you are searching for a node it will list the title, file, todo, and olp. This is enough context to make it easy to select the one you are looking for.

```
 (setq org-roam-node-display-template
          (concat 
            (propertize "${todo:10} " 'face 'org-todo)
            (propertize "${tags:30} " 'face 'org-tag)
            "${title:40} "
            "${file:30}"
            "${olp}"
            ))

```

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [October 12, 2024, 8:24am UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/6 "2024-10-12T08:24:47Z")

</div>

> [@orgroamer](#):
>
> My primary issue was I’m not sure how to create 2 nodes with identical titles, or if it’s possible without further modification.

- I have a node entitled “Day 1”.
- I want to create a new node with the same title with `org-roam-capture` or `org-roam-node-find`.
- But if I enter “Day 1” in the minibuffer and press RET, I end up navigating to the existing node.
- Can I create a new node with the same title?
- If yes, how?

Is this your question? Yes, you can. How to do this depends on your package for completion. Assuming you are using the popular Vertico package, then you can move your cursor to the prompt with the up arrow key or its equivalent—I use C-p—then press RET. Or you can press M-RET without moving to the prompt. If you use some other package like Ivy or Helm, the actual keybinding and command name differ.

This is documented in Vertico’s [README](https://github.com/minad/vertico?tab=readme-ov-file#key-bindings). It may need getting used to, to read this type of generic explanation in widely used Emacs packages like Vertico.

> Note in particular the binding of `TAB` to `vertico-insert`, which inserts the currently selected candidate, and the binding of `RET` and `M-RET` to `vertico-exit` and `vertico-exit-input`respectively.

> `vertico-exit` exits with the currently selected candidate, while `vertico-exit-input` exits with the minibuffer input instead. Exiting with the current input is needed when you want to create a new buffer or a new file with `find-file` or `switch-to-buffer`. As an alternative to pressing `M-RET`, move the selection up to the input prompt by pressing the `up` arrow key and then press `RET`.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [October 12, 2024, 8:45am UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/7 "2024-10-12T08:45:45Z")

</div>

> [@orgroamer](#):
>
> If having same titled notes is possible, perhaps the best solution is excluding them from org-roam-node-find altogether, and only navigating to them from other nodes?

I would take this approach. A project can be a node, so “Project A”, “Project B”, etc. will appear in the minibuffer. I would keep “Day 1”, “Day 2”, etc. in each project to be normal headlines and not nodes (so no IDs will be assigned to them).

It would be easy to visit a project node via org-roam-node-find, and no need for complex method to differentiate “Day 1” in various projects.

For my real use, I have a single Org file named “[projects.org](http://projects.org)” and all my projects go there. Each project is a level-1 headline. None of them for me appears in Org-roam—none, including the [projects.org](http://projects.org), are node. Works for me. I differentiate projects from notes, and only the latter go to Org-roam.

---

<div class="post-metadata">

**Author:** ![orgroamer](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@orgroamer](https://org-roam.discourse.group/u/orgroamer)\
**Post date:** [October 17, 2024, 12:52pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/8 "2024-10-17T12:52:08Z")

</div>

Thank you for telling me about this. I tried doing this, and it does open a new capture window, but with the same file that already exists (I know this because editing the file in the capture buffer edits the existing one).

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [October 17, 2024, 2:24pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/9 "2024-10-17T14:24:42Z")

</div>

> [@orgroamer](#):
>
> but with the same file that already exists

Then modify your capture template so that the file name will be unique. For example, you can add subdirectory (one for each topic) or a time stamp. I use a timestamp as the ID and a prefix to my file names (even outside org-roam). This is not really an “issue” within Org-roam; it gives you functionality with which you can solve your issue with file naming conflicts.

---

<div class="post-metadata">

**Author:** ![orgroamer](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@orgroamer](https://org-roam.discourse.group/u/orgroamer)\
**Post date:** [November 1, 2024, 2:36pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/10 "2024-11-01T14:36:10Z")

</div>

OK, done, thank you! I’d forgotten that the capture templates specify file name and not just body.

---

<div class="post-metadata">

**Author:** ![dmg](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dmg](https://org-roam.discourse.group/u/dmg)\
**Post date:** [November 1, 2024, 8:27pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/11 "2024-11-01T20:27:53Z")

</div>

Remember that you can always rename the file in dired. I believe org-roam will update the data accordingly.

---

<div class="post-metadata">

**Author:** ![JGT](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@JGT](https://org-roam.discourse.group/u/JGT)\
**Post date:** [December 5, 2024, 9:08pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/12 "2024-12-05T21:08:31Z")

</div>

I seem to be having the same problem as in this thread:

I want two nodes to have the same name (i.e., one for a person’s name and one for any talks they give). I would like to store the different nodes in different directories (e.g., people/JohnSmith.org and talks/JohnSmith.org). When I make a person, it works fine. When I then try to make a talk by the same person (even using the Vertigo trick), I always get the file with the person, not a new file for the talk.

Here is a minimal capture template:

```auto
(setq org-roam-capture-templates
      '(("1" "default" plain "%?"
         :target (file+head "test1/%<%Y%m%d%H%M%S>-${slug}.org"
                            "#+title: ${title}\n")
         :unnarrowed)
        ("2" "person" plain "%?"
         :target (file+head "test2/%<%Y%m%d%H%M%S>-${slug}.org"
                            "#+title: ${title}\n")
         :unnarrowed)))

```

I have also tried this:

```auto
(setq org-roam-capture-templates
      '(("1" "default" plain "%?"
         :target (file+head "test1/${slug}1.org"
                            "#+title: ${title}\n")
         :unnarrowed)
        ("2" "person" plain "%?"
         :target (file+head "test2/${slug}2.org"
                            "#+title: ${title}\n")
         :unnarrowed)))

```

I’m using doom emacs if that is relevant.

Thank you for any suggestions!

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 5, 2024, 10:29pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/13 "2024-12-05T22:29:45Z")

</div>

I suggest to use some customizing to display different candidate names, eg directory and title, with this ([link](https://github.com/org-roam/org-roam/wiki/User-contributed-Tricks#filtering-by-subdirectory))

---

<div class="post-metadata">

**Author:** ![JGT](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@JGT](https://org-roam.discourse.group/u/JGT)\
**Post date:** [December 6, 2024, 3:25pm UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/14 "2024-12-06T15:25:12Z")

</div>

That worked perfectly, thank you!

---

<div class="post-metadata">

**Author:** ![inkbottle](https://avatars.discourse-cdn.com/v4/letter/i/5e9695/32.png) [@inkbottle](https://org-roam.discourse.group/u/inkbottle)\
**Post date:** [December 26, 2024, 3:20am UTC](https://org-roam.discourse.group/t/nodes-with-same-title/3614/15 "2024-12-26T03:20:57Z")

</div>

> [@nobiot](#):
>
> Perhaps you could give us some of your real examples and discuss the matter further.

I have a “real example” here: [Literature notes - #2 by inkbottle](https://org-roam.discourse.group/t/literature-notes/3710/2)

In short, Luhmann seems to use as many different sheets of paper for his “literature notes” as he has things to say about a source, with each note being very short.

Finding a different note/node title each time would completely slow down the note-taking workflow.

Jethro has solved this for himself by using one giant file, but it’s certainly not for everyone, I think it can have a mind freezing effect.

You and others have suggested several solutions, I’ll see how I can use them.
