Transclusion Not working as expected when linking outside of the group

Hi,
I am trying to remove obsidian from my workflow and use 100% DT.
But, I have some issues with Transclusion.
Normally, I can transform a link [[ ]] to Transclusion just by adding ! before.
In DT, It is working fine when the target file is in the same group. But have a strange behaviour (I think) when the target link is outside of the group.
To get it work from outside, I need to start from scratch and choose the file from the popup menu. And even with that, it transform it to a link that do not show the title/name of the note.
I added a capture screen to show the concern :


Thank you for your help

Right now transclusion supports item links, paths relative to the current group and absolute paths. The name is only sufficient if the destination is in the same group.

Thank you, Cgrunenberg, for your reply.

In that case, DT documentation is miss-leading :
“File Transclusion: A special feature of DEVONthink’s Markdown handling is support for file transclusion. This provides the capability of displaying the contents of one file inside the contents of a Markdown file. This supports displaying the contents of plain text, HTML, or other Markdown files. For example, you may have several chapters of a book written in individual Markdown files. Use transclusion to view them all as one document with out the need to merge or copy and paste the content between files, similar to some popular writing applications.
To use transclusion, just enter the desired document’s name or item link between double braces, e.g., {{Chapter 1}}. Transclusion supports filenames with and without extensions, relative and absolute links, as well as item links. It also supports the Obsidian syntax, e.g., ![[Chapter 2.md]].”

In general, when we write, we keep place holders, like : ![[Section 2 - Third Punic War - Siege of Carthage]], it will fill up after, when we will have written that target text.
On paper, yes, DT have File Transclusion, but in our daily reality, it’s not usable the way Transclusion was designed (Just my thoughts, I could be wrong)

I have two quick questions :

  • Is it something that DT team is working on to improve. Or, it’s how DT works?
  • Could you please give me an example of an absolute path? Should we start from DB file location or from /users/… ?

Thank you again for your answer,
Have a nice day my friend,
Rachik

It’s currently the way it works but a future version might improve this.

BTW: You could also use replication to make this more flexible if your transclusions only use the name, e.g. replicate the items required by a document to the same group.

If document A is located in group 1 which is located in group 2, then the absolute path would be /2/1/A.

Are you also using Obsidian?

Yes, I am using Obsidian to structure my ideas.
But, I want to work from a single platform, and DT have all the needs. I am just trying to adapt.

Hi,
I didn’t understand the absolute path explanation :frowning:

Example :
I have “File1” under “group1” and “File2” under “Group2”
I want to create Transclusion link within “File1” pointing to “File2”

What I need to put between brackets (on “File1”)?
![[ ??? ]]

But where are group 1 and 2 relative to the Markdown document’s location?

They could be anywhere on that Database.
I just want to see an example, because I am not able to make it happen (absolute path on a Transclusion link)

I have a database called Diaries. I create a new markdown record in a group called Temp (the path to which is /Temp ). I then create a transclusion as follows:

{{/Diary entries/2000-2009/2000/Thursday 13 January 2000}}

and that works perfectly for me to show that item in the new record.

Edit:…when viewed in rendered view, of course.

Stephen

1 Like

Great, thx my friend Stephen.
Then, the absolute path is not on the finder side, it’s what we are seeing in DT view :+1:
Now, I can move my transclusion links (example)
from :
{{x-devonthink-item://74B72840-1F0E-4537-BDE6-F89A21830CE7}}
to :
{{/Cloud/CACF-Benefit}}
Its visually more clear.


Note: After testing, when we need to create a placeholder transclusion links, we need to add the file type, in this case {{/Cloud/CACF-Benefit.md}}.
Without the file extention, it will not work after we create the file “CACF-Benefit”.
But, if the target file already exist when creating the transclusion links, then the file extention is not needed. Perhaps, it was intentionally done by DT Dev team.

Thank you again my friend Stephen :pray:

This Script: Copy for Markdown transclusion might be useful.

1 Like

Since version 3.8 you can also just drag & drop Markdown documents and images while pressing the Ctrl modifier key to insert a transclusion. Depending on the location of both documents either a path or an item link is used.

Likewise drag & drop while pressing Cmd-Alt modifier keys inserts cross-links.

1 Like

The next release will also support transclusions using just the name (with/without extension) as long as it’s unique.

1 Like

This is a great News :ok_hand:
Thx Cgrunenberg

I tested them, they are working as expected, thx Cgrunenberg :pray:


I noticed something that perhaps need your attention.
In the bellow example :

I am testing the two syntax for transclusions links. They are working fine.

But, if we need to change the other wikilinks in the global text for item links, we will use :
Tools > Item Links > Convert Wikilinks to item links
That work fine.
But, it will destroy the transclusions link with {{ }} syntax, like shown bellow :

Transclusions shouldn’t be updated at all, I’ll check this. Thanks!

1 Like

And fixed.

1 Like

Hi there - I excitedly downloaded DEVONthink 3.8.1 today after I saw the following in the release notes:

Markdown transclusions support references using file names without the extension as long as the name is unique.

This works now (thanks! :tada:), but admittedly still not as I expect due to two subtle annoyances:

  • I still have to include the file extension to get transclusion to work
  • the wiki link isn’t clickable from the Source window like other wiki links are.

Here’s a quick screenshot to illustrate:

More info about my setup, in case it’s relevant:

I’m using DEVONthink with Obsidian, by indexing my Obsidian vault with DT. Most of my files are in two Groups (call them A and B). I’m trying to use the ![[ ]] Obsidian syntax to transclude a document that resides in Group B into a document which is in Group A.

All of my documents have a unique file name, as I use a datetime prefix along with a file name (confirmed this by using Go > To Document… by the filename and only a single result appears).

How about a screencap of the filing system where these files are located in DEVONthink?