[Absolute or Relative path] `Default location for new notes` should be ignored when creating files by following a link. The link itself should be used

Hi WhiteNoise,

Will you consider adding a format conversion feature that converts all the links in the vault to either absolute or relative path links? This will make all the links in the vault consistent in format and also make the feature requested here in this thread possible.

You can open another FR for the conversion.
It will not solve this FR because we don’t want that [[file]] points to a file under one rule and to another file under a different rule. What will solve this FR is forcing relative users to have links that begin with either ./ or ../.

EDIT: renamed this FR.

I think it doesn’t matter that " [[file]] points to a file under one rule and to another file under a different rule", because every time you switch to another mode, the [[file]] will be converted to, say, [[…/file]], and it still points to the same file.

But anyway, you are the expert in this kind of problems, and I’m sure you have your considerations. I 100% respect your decisions.

Thank you so much!

Steps to reproduce

In a subfolder within a vault, insert an explicit relative link [[./x/y]]. Hover-preview the link and click to open it, or use the open link under cursor command.

Expected result

A note x/y.md is created in a subdirectory of the folder the note is in, and the note is opened

Actual result

The operation silently fails after creating x/y.md under the vault root.

Environment

  • Operating system: Windows
  • Obsidian version: 0.12.19

Additional information

It doesn’t matter what the link creation setting is set to.

In 11.1 a new feature was added that would create new files as well as new folders based on a link. I am not sure if this is a bug, or I am using it wrong.

Steps to reproduce

In a random folder create a note with an embedded link.

[[NewFolder/NewNote]]

Expected result

I would expect it to create a new folder in the current directory and a new file in the newly created directory.

Actual result

The new folder is created in the Root folder.

Environment

  • Operating system: W10
  • Obsidian version: 0.11.3

Additional information

I am using these new links in templates. To me, that is where this feature really shines. If you were creating the link by hand you could use absolute path, but wouldn’t the ability to make it relative also make sense. Thanks.

ce

4 Likes

The folders are created according to your settings in Files & Links and Default location for new notes for new link format. I am not sure how those two interact when you specify the folder as part of the links. As far as I know if you have Shortest path when possible this means at the root of your vault.

Yes Sir, I understand what you are saying and I would expect it to behave the same. My Default location for new notes is set to “Same folder as current file”. I think the issue is a new folder is created before a new note is created, so the new note option is probably not used. To me it would make sense for the new folder to follow the same option selected for new notes. I know that may be a bit confusing, but if we look at notes and folders as entities then it falls in line. Thanks for responding, and thanks for a great application.

ce

I am not sure why this got moved to Help. I assume you are saying it’s not a bug. That links that create folders as well as files will always default to root folder.

ce

Can you add a screenshot of the note you’re writing in and its location in the file explorer?

Yes. I am not yet sure this is neither a bug nor a feature request. Don’t worry, I’ll move it to the right category once I know for sure!

My Config setting, so no doubt…

The location of file which contains link…

2021-03-04 06_29_45-TestVault_ce - Obsidian v0.11.3

What my link looks like…

2021-03-04 06_30_00-TestVault_ce - Obsidian v0.11.3

Location of new folder and new note…

2021-03-04 06_30_29-TestVault_ce - Obsidian v0.11.3

Like I said in my original post, I believe the issue is the the newly created folder is not adhering to the New Note setting. I completely understand why that would be the case; folder vs note. It seems like a bit of overkill to have a new setting for just this use case. Thus my mention of just using the New note setting to apply to folders created in this manner. I would create a new setting, but also freely admit that I have OCD issues; LOLOL. I am sure if I include the full path it would work as expected. If I were to type it by hand, being able to use relative path makes sense. I am not typing the link, I am using it in templates, and once again being able to use relative path makes sense.

ce

Alright, I can confirm that right now it’s not possible to specify relative paths in the inline links. Moving this to #feature-requests and editing the title to specify the use case

1 Like

Thanks. Sorry for the confusion.

ce

I am using Templater, so I used {{tp_folder:vault_path=true}} as part of my New link to get around the issue. I still think this would be a great feature to add for those not using Templater, or a plugin which will give you the full path to current folder. Thanks again for a great application.

ce

@Chuckle123, thank you for reporting and documenting this behavior.


This also occurs without Wiki links, i.e. with Markdown links.

Examples:

  • [example 1](NewFolder/NewNote)
  • [example 2](NewFolder/NewNote.md)
  • [example 3](./NewFolder/NewNote)
  • [example 4](./NewFolder/NewNote.md)

Questions

  1. @argentum (or Obsidian team or community), what other non-Templater workarounds exist? (I know only one.)

Workaround:

  1. Create file in folder (let Obsidian create folder and file as if from root).
  2. Move file to appropriate location.
  3. Confirm link does not update, but will still navigate to file.

Discussing the “bug” Cannot create note by clicking link if it contains slashes we came up with the idea

Would you at least consider to have a setting to make links relative? For those who rely on current behavior, they just won’t set it

1 Like

I read your request. I agree that (while I do not use relative paths for new notes) the behavior of the “Click on non-existent note to Create” should be similar to that of a Cmd+o

If I were having to manually move all of my new bracket-link created notes to their respective folders, I would also be making this request. Perhaps a future vault of mine will need this.

There is a plugin called Consistent Attachments and Links that may solve this.

For some INEXPLICABLE reason the Obsidian team refuses to deal with folders as selectable and as context. I should be able to open a folder and have it the “current folder” and new nites should be there by default. That is pretty much a universal standard of behavior, but for some reason Obsidian team doesn’t support this.

1 Like

Did they say they won’t do it? Or they just haven’t prioritized it yet?