Feature Request: Access to the name of the calling file in transclusions

Description

Currently, Obsidian allows transclusion of files via ![[File]]. This embeds the content of one file into another. However, the embedded file has no way of knowing which “parent file” is calling it.

Problem:

  • Transcluded files are context‑free.

  • There is no variable or function that returns the name of the calling file.

  • As a result, dynamic templates or context‑aware content cannot be created.

Proposal:

  • Introduce a special variable such as {{parent}} or {{caller}} that, inside the embedded file, returns the name (or path) of the calling file.

  • Optionally, make this variable available in plugins like Templater or Dataview.

Benefits:

  • Enables context‑aware notes (e.g., automatically displaying the parent title).

  • Simplifies the creation of reusable templates.

  • Strengthens automation and dynamic content possibilities in Obsidian.

These aren’t variables in the manner you’re asking for, but I’m mentioning them because I don’t know your use case.

If you want a variable you can use in a template to return a hard-coded list of files, something like your request would cover that.

But if you want to access, display, filter on, or calculate info from notes that contain specific embeds:

  • Dataview makes them accessible with the meta(link).embed function.
  • Bases gives you accesses with the file.embeds property.
  • Plugins can get the info in the CachedMetadata interface.
1 Like