A better workflow for transcluded links

By a transcluded link I mean a link which has a pipe in its definition - so the text displayed as link is different from the story it links to: [[file|display text]]

I find the process of creating/editing such links very clumsy. Since it is usually so that I have myt text ready, and then I add a link to it by wrapping word(s) within a double [[, I would like Obsidian to recognize it - and when I press the second [ it should capture the text being wrapped as the display text portion that will FOLLOW (ie. after the pipe character), and let me select the file and place my selection before that pipe character.

The same popup should make it straightforward for us to define the target anchor position, ie. where to scroll to in the target file when the link is clicked.

IMO it’d be best if both, during creation and upon caret placement within, a popup showed up with two fields so that it is not necessary to fiddle with text. If the alias text is empty then the link display the story title.

3 Likes

Totally agree about a better way to modify links and your recommended gestures for doing that are spot on. CHeers!

FYI - these are not transluded links. Adding the pipe indicates we’re changing the display text for the link. A transcluded link is one that the content of the link is displayed (it uses the ! mark before the link).

1 Like

Link with Alias plugin. As long as you have the alias of ‘display text’ in the target note, it will automatically format [[file|display text]] and create the link. I use it constantly when writing and creating links for as yet non-existent notes, in which case you have the option to add that alias automatically. It also works well with existing notes. Triggering the plugin shortcut shows the [[file|display text]] options you have for highlighted text or word.

Ok, so maybe aliased or labeled would be a better adjective then

Thanks for the recommendation. TBH, I can’t get this plugin to work the way it’s shown in those animated gifs on github. The plugin is enabled, the app has been restarted, but it doesn’t show any extra commands or menu items. Maybe it’ll get clear with time.

You don’t need the community plugin. You can add aliases as properties to notes. For example in the note file.md you could add:

---
aliases:
  - display text
---

The aliases will show up when you start typing [[.

Aliases are especially useful in combination with the core plugin Backlinks.

There should be 3 new commands in the command palette and you can assign a hotkey to them. All three start with Link with Alias. I also added it to the right click menu for when highlighting, but it’s not there automatically.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.